Skip to content

[added] Enable rootClose for OverlayTrigger #698

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

Merged
merged 1 commit into from
May 19, 2015

Conversation

taion
Copy link
Member

@taion taion commented May 18, 2015

Fixes #233

@taion taion force-pushed the overlay-root-close branch from 134da4e to 2f22104 Compare May 19, 2015 04:29
@mtscout6
Copy link
Member

It may be worth noting as a warning that the hover option alone may not meet accessibility requirements since there is no way for a keyboard user to see the popover. Also, hover does not play well with mobile touch screen users since you can hover your finger over the screen as long as you want and that would never trigger. At least not till phones advance enough to watch our hands when not touching the screen, but that just gets creepy 😨.

@taion
Copy link
Member Author

taion commented May 19, 2015

Galaxy S5 actually had it (got taken out for S6). I think BlackBerry Storm might have had something analogous as well.

I think hover is of very limited use for Popovers, but thought it would be appropriate to demonstrate all the options for trigger.

@taion
Copy link
Member Author

taion commented May 19, 2015

BTW, this is really annoying:

function handleHide() {
alert('Close me!');
}

The static modal isn't actually hideable, so you just get that alert every time you hit escape on the components page. IMO we should get rid of it entirely.

The root close logic should be merged across this, modals, and dropdowns as much as possible, but not until after your dropdown changes land, I think.

@mtscout6
Copy link
Member

You last comment I assume is what triggered #701 😉

I agree about that close logic, though I don't know who well a wrapper component will work. With the DropdownButton we don't remove the DropdownMenu from the DOM when it's collapsed, it's hidden with CSS.

@taion
Copy link
Member Author

taion commented May 19, 2015

And the "background click" logic for modals isn't quite the same either. I'd just like to avoid duplicating the logic between this and dropdowns, as much as possible.

@mtscout6
Copy link
Member

Understandable, I'm just thinking it could be more of a utility function to call as opposed to a component wrapper. The main issue is adding that event listener and removing it accordingly. The dropdown changes don't need the key event listener though since focus will be on the DropdownMenu. I'm wondering if it's even needed in the Modal once #690 is complete since the Modal will have focus as well.

@AlexKVal
Copy link
Member

iPad:

Click works as expected
Hover yeah 😄 it pops by clicking on it, but it can't be dismissed by any way.
(only by clicking on the Click button)
Focus - doesn't work at all.
Click+rootClose as I suspected it works only as Click.
because of the same as in #204 hack for iOS needed.

BTW: npm run docs with iPad doesn't work now. Only npm run docs-prod

@taion
Copy link
Member Author

taion commented May 19, 2015

Does the same problem apply to dropdowns as well on iOS?

@AlexKVal
Copy link
Member

I havn't checked.
Give me a sec.

@mtscout6
Copy link
Member

The dropdowns don't have a hover or on focus trigger though so I wouldn't image this being a problem. Although there is a request to support it. I'm fine with having them, but we should at least warn people of the ramifications.

@AlexKVal
Copy link
Member

Dropdown buttons are OK.
Dropdowns in Navbar are Not dismiss by tapping outside of them.

@taion
Copy link
Member Author

taion commented May 19, 2015

Which fixes do we need before merging this?

@mtscout6
Copy link
Member

I'd like some added documentation warning about the two usages described above for Mobile and Accessibility considerations.

@taion
Copy link
Member Author

taion commented May 19, 2015

Updating documentation:
image

I'd prefer to sort out issues with iOS click hack for rootClose and on dropdowns in nav per @AlexKVal's comments separately from this PR.

@taion taion force-pushed the overlay-root-close branch from 2f22104 to d575c63 Compare May 19, 2015 21:47
@taion taion force-pushed the overlay-root-close branch from d575c63 to 5dc0ac2 Compare May 19, 2015 21:47
@mtscout6
Copy link
Member

:shipit:

taion added a commit that referenced this pull request May 19, 2015
[added] Enable rootClose for OverlayTrigger
@taion taion merged commit 115412e into react-bootstrap:master May 19, 2015
@taion taion deleted the overlay-root-close branch May 19, 2015 23:23
@aldendaniels
Copy link

@mtscout6 - A minor suggestion: close the overlay on mousedown instead of (or in addition to) on click.

This doesn't match Bootstrap's built-in functionality, but it does match the browser's native context menu functionality and feels more responsive.

@taion
Copy link
Member Author

taion commented May 20, 2015

@aldendaniels I agree. I think the new dropdown menu code does what you say. Once we merge that, we can be consistent about closing the overlay on mousedown.

@eventhough
Copy link

@taion Thanks for adding the functionality to address Popover dismissal. Do you have an example or demo we can look at to get this working? I'm not sure how to use the rootClose property.

@taion
Copy link
Member Author

taion commented May 20, 2015

@hugoduraes
Copy link

I would like to be able to provide a callback to be executed on closing the popover. How can I achieve this?

@mtscout6
Copy link
Member

@hugoduraes I don't believe we currently do not have a mechanism in place for invoking a callback on popover close. Feel free to submit a pull request if you'd like one in there, sounds reasonable enough to me to have.

aryad14 pushed a commit to aryad14/react-bootstrap that referenced this pull request Oct 11, 2023
…strap#698)

Bumps [elliptic](https://github.com/indutny/elliptic) from 6.4.0 to 6.5.4. **This update includes a security fix.**
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](indutny/elliptic@v6.4.0...v6.5.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.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.

Popover dismiss on next click
6 participants