Skip to content

Commit

Permalink
fix(list-item): Always display open toggle cell. #8667
Browse files Browse the repository at this point in the history
  • Loading branch information
driskull committed Jan 30, 2024
1 parent 80dec4e commit ef27d6c
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions packages/calcite-components/src/components/list-item/list-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -473,19 +473,23 @@ export class ListItem
renderOpen(): VNode {
const { el, open, openable, messages } = this;
const dir = getElementDir(el);
const icon = open ? ICONS.open : dir === "rtl" ? ICONS.closedRTL : ICONS.closedLTR;
const tooltip = open ? messages.collapse : messages.expand;
const icon = openable
? open
? ICONS.open
: dir === "rtl"
? ICONS.closedRTL
: ICONS.closedLTR
: ICONS.blank;

return openable ? (
<td
class={CSS.openContainer}
key="open-container"
onClick={this.handleToggleClick}
title={tooltip}
>
const tooltip = openable ? (open ? messages.collapse : messages.expand) : undefined;

const openClickHandler = openable ? this.handleToggleClick : undefined;

return (
<td class={CSS.openContainer} key="open-container" onClick={openClickHandler} title={tooltip}>
<calcite-icon icon={icon} key={icon} scale="s" />
</td>
) : null;
);
}

renderActionsStart(): VNode {
Expand Down

0 comments on commit ef27d6c

Please sign in to comment.