Skip to content

Commit

Permalink
fix(web-components): Fix tooltip handling (#166)
Browse files Browse the repository at this point in the history
* fix(SideNavigation): Don't render zero if no footerItems present

Fixes #164

* fix(web-components): Fix tooltip handling
  • Loading branch information
MarcusNotheis authored and Lukas742 committed Oct 1, 2019
1 parent 7e4946a commit d721e2b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
11 changes: 3 additions & 8 deletions packages/main/src/components/SideNavigationListItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,11 @@ const SideNavigationListItem: FC<SideNavigationListItemProps> = forwardRef(

return (
<>
{/*
// @ts-ignore */}
<CustomListItem
selected={isSelfSelected || hasSelectedChild}
ref={ref}
className={listItemClasses.valueOf()}
title={tooltip}
tooltip={tooltip}
slot={slot}
style={style}
data-id={id}
Expand All @@ -114,20 +112,17 @@ const SideNavigationListItem: FC<SideNavigationListItemProps> = forwardRef(
openBy={<Icon src={icon} className={classes.icon} />}
>
<List>
{/*
// @ts-ignore */}
<StandardListItem selected={isSelfSelected} data-id={id} title={tooltip}>
<StandardListItem selected={isSelfSelected} data-id={id} tooltip={tooltip}>
{text}
</StandardListItem>
{validChildren.map((child: any, index) => {
return (
// @ts-ignore
<StandardListItem
selected={props['selectedId'] === child.props.id}
key={index}
data-id={child.props.id}
data-parent-id={id}
title={child.props.tooltip || child.props.text}
tooltip={child.props.tooltip || child.props.text}
>
{child.props.text}
</StandardListItem>
Expand Down
4 changes: 2 additions & 2 deletions packages/main/src/internal/withWebComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,9 @@ export function withWebComponent<T>(WebComponent): RefForwardingComponent<Ui5Dom
// render
const { regularProps: passedProps, slotProps: actualSlotProps } = getRegularProps();

const { children, ...rest } = passedProps as T & WithWebComponentPropTypes;
const { children, tooltip, ...rest } = passedProps as T & WithWebComponentPropTypes;
return (
<CustomTag {...getBooleanProps()} ref={getWcRef()} {...rest} class={className}>
<CustomTag {...getBooleanProps()} ref={getWcRef()} {...rest} title={tooltip} class={className}>
{Object.keys(slots).map((slot) => {
if (actualSlotProps[slot]) {
return Children.map(actualSlotProps[slot], (item: ReactElement<any>, index) =>
Expand Down

0 comments on commit d721e2b

Please sign in to comment.