Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

checking POPOVER_DISMISS not working in custom itemListRenderer or itemRenderer #6904

Open
HZ-labs opened this issue Jul 11, 2024 · 0 comments

Comments

@HZ-labs
Copy link

HZ-labs commented Jul 11, 2024

When using custom components for Select's itemRenderer or itemListRenderer that don't use the .bp5-menu-item, shouldDismiss is always true. We use custom components without the .bp5-menu-item for customization and don't want to rewrite blueprint system styles.

It would be more useful to get menuItem by

const menuItem = target?.closest('[role="menuitem"]');

or modify the code as follows:

const menuItemDismiss = menuItem?.matches(`.${CoreClasses.POPOVER_DISMISS}`) ?? false;

Reference:
https://github.com/palantir/blueprint/blob/5d92d0e4ea1cebc4538faad72dcfce4cd340c613/packages/select/src/components/select/select.tsx#L303C9-L303C71

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant