Skip to content

Commit

Permalink
fix(flow-item): Use a native tooltip for the back button (#7442)
Browse files Browse the repository at this point in the history
**Related Issue:** #7436 #7433

## Summary

- Use a native tooltip for the back button. #7436
- This is the only component that uses a tooltip by default so it seems
like we shouldn't do this
- A native tooltip probably makes more sense as the back icon is pretty
recognizable
  • Loading branch information
driskull authored Aug 4, 2023
1 parent 70b45cf commit f38167b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,6 @@ describe("calcite-flow-item", () => {

expect(backButtonNew).not.toBeNull();

const backButtonTooltip = await page.find(`calcite-flow-item >>> calcite-tooltip`);

expect(backButtonTooltip).not.toBeNull();
expect(await backButtonTooltip.getProperty("closeOnClick")).toBe(true);

expect(await backButtonNew.isVisible()).toBe(true);

const calciteFlowItemBack = await page.spyOnEvent("calciteFlowItemBack", "window");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ export class FlowItem

containerEl: HTMLCalcitePanelElement;

@State()
backButtonEl: HTMLCalciteActionElement;

@State() defaultMessages: FlowItemMessages;
Expand Down Expand Up @@ -292,6 +291,7 @@ export class FlowItem
scale="s"
slot="header-actions-start"
text={label}
title={label}
// eslint-disable-next-line react/jsx-sort-props
ref={this.setBackRef}
/>
Expand All @@ -309,9 +309,7 @@ export class FlowItem
loading,
menuOpen,
messages,
backButtonEl,
} = this;
const label = messages.back;
return (
<Host>
<calcite-panel
Expand Down Expand Up @@ -340,17 +338,6 @@ export class FlowItem
<slot name={SLOTS.footer} slot={PANEL_SLOTS.footer} />
<slot />
</calcite-panel>
{backButtonEl ? (
<calcite-tooltip
closeOnClick={true}
label={label}
overlayPositioning="fixed"
placement="top"
referenceElement={backButtonEl}
>
{label}
</calcite-tooltip>
) : null}
</Host>
);
}
Expand Down

0 comments on commit f38167b

Please sign in to comment.