Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
0c35c01
feat: add _show prop to popover-button
yurtsever Oct 28, 2025
584740a
fix: reorder prop definition
yurtsever Oct 29, 2025
20fb60f
fix: tests
yurtsever Oct 29, 2025
b0aea25
fix: revert table changes
yurtsever Oct 29, 2025
ca0d0b4
update: change show prop to open
yurtsever Oct 29, 2025
8acf980
fix: revert open prop to show
yurtsever Oct 30, 2025
bbca1bb
fix: revert snapshot
yurtsever Oct 30, 2025
299a231
Update all snapshots$
yurtsever Oct 30, 2025
2320871
fix: validators and prop definitions
yurtsever Oct 31, 2025
80baa1b
merge branch
yurtsever Oct 31, 2025
f676770
fix: Adjust prop docs and show prop validation
yurtsever Oct 31, 2025
4618725
fix: update snapshot viewport
yurtsever Oct 31, 2025
13b93e8
fix: snapshot viewport
yurtsever Oct 31, 2025
5abd8cb
feat: add test case for default state
yurtsever Nov 3, 2025
c27ec59
fix: remove snapshot for windows
yurtsever Nov 3, 2025
4c3c400
feat: add missing test code
yurtsever Nov 3, 2025
8dfd7e7
Update all snapshots$
yurtsever Nov 3, 2025
29e636c
Merge branch 'release/3' into 8714-add-show-prop
yurtsever Nov 6, 2025
7bfc129
fix: handle popover after render
yurtsever Nov 6, 2025
6151652
Merge branch 'release/3' into 8714-add-show-prop
yurtsever Nov 6, 2025
dc534f8
Merge branch 'release/3' into 8714-add-show-prop
yurtsever Nov 7, 2025
2b2cecb
refactor: remove _show prop and related validation from KolPopoverBut…
deleonio Nov 12, 2025
8be41d0
Update all snapshots$
yurtsever Nov 12, 2025
8ad2f5d
fix: Remove tests for _show prop
yurtsever Nov 12, 2025
bc3ee56
Merge branch 'release/3' into 8714-add-show-prop
yurtsever Nov 13, 2025
0acdd36
Update all snapshots$
yurtsever Nov 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions packages/components/src/components/popover-button/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,20 @@ export class KolPopoverButton implements PopoverButtonProps {
void this.refPopover?.hidePopover();
}

/**
* Show the popover programmatically by calling the native showPopover method.
*/
@Method()
// eslint-disable-next-line @typescript-eslint/require-await
public async showPopover() {
void this.refPopover?.showPopover();
}

/**
* Sets focus on the internal element.
*/
@Method()
public async kolFocus() {
// eslint-disable-next-line no-console
console.log('Focusing popover button', this.refButton);
await this.refButton?.kolFocus();
}

Expand Down
9 changes: 9 additions & 0 deletions packages/components/src/components/popover-button/shadow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ export class KolPopoverButton implements PopoverButtonProps {
void this.ref?.hidePopover();
}

/**
* Shows the popover programmatically by forwarding the call to the web component.
*/
@Method()
// eslint-disable-next-line @typescript-eslint/require-await
public async showPopover() {
void this.ref?.showPopover();
}

private catchRef = (ref?: HTMLKolPopoverButtonWcElement) => {
this.ref = ref;
};
Expand Down
18 changes: 8 additions & 10 deletions packages/samples/react/src/components/popover-button/basic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,6 @@ export const PopoverButtonBasic: FC = () => {
const { dummyClickEventHandler } = useToasterService();
const buttonRef = React.useRef<HTMLKolPopoverButtonElement>(null);

useEffect(() => {
const run = async () => {
await buttonRef.current?.kolFocus();
if (buttonRef.current instanceof HTMLButtonElement) {
buttonRef.current.click();
}
};
run();
}, []);

const dummyEventHandler = {
onClick: dummyClickEventHandler,
};
Expand All @@ -40,6 +30,14 @@ export const PopoverButtonBasic: FC = () => {
},
];

useEffect(() => {
// Ensure the popover is closed on initial render
if (buttonRef.current) {
buttonRef.current.showPopover();
buttonRef.current.kolFocus();
}
}, []);

return (
<>
<SampleDescription>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions packages/tools/visual-tests/tests/sample-app.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,10 @@ ROUTES.set('popover-button/basic', {
zoom: {
skip: true,
},
viewportSize: {
width: 200,
height: 220,
}
},
});
ROUTES.set('progress/basic', {
Expand Down
Loading