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

[datetime] fix: clicking shortcuts no longer dismisses popovers #5219

Merged
merged 2 commits into from
Apr 1, 2022

Conversation

not-inept
Copy link
Contributor

@not-inept not-inept commented Apr 1, 2022

Fixes #3338

By default MenuItem has Classes.POPOVER_DISMISS added to the component, controlled by the shouldDismissPopover prop.

The Shortcuts component clearly intended to block this behavior through the use of Classes.POPOVER_DISMISS_OVERRIDE.

However, per the Popover and Popover2 components, a dismiss inside an override still dismisses.

Luckily, MenuItem has a prop just for this!

Changes proposed in this pull request:

Stop datepicker shortcuts from dismissing popovers

Reviewers should focus on:

If this correctly dismisses popovers and aligns with the author's original intent.

Screenshot

(Imagine a picture of a happy dev, not having to insert some hack to strip the dismiss class from the child menuitem)

@not-inept not-inept requested a review from adidahiya April 1, 2022 18:59
@blueprint-bot
Copy link

lint

Previews: documentation | landing | table | demo

@adidahiya
Copy link
Contributor

before:
2022-04-01 15 47 45

after:
2022-04-01 15 47 58

Copy link
Contributor

@adidahiya adidahiya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice one, thanks @not-inept!

@adidahiya adidahiya changed the title Stop datepicker shortcuts from dismissing popovers [datetime] fix: clicking shortcuts no longer dismisses popovers Apr 1, 2022
@adidahiya adidahiya merged commit f178a45 into develop Apr 1, 2022
@adidahiya adidahiya deleted the mrc/dismissive-dates branch April 1, 2022 19:49
not-inept added a commit that referenced this pull request Apr 1, 2022
Co-authored-by: Mason Cooper <mcooper@palantir.com>
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

Successfully merging this pull request may close these issues.

DateRangePicker shortcuts incorrectly dismiss popovers
3 participants