Skip to content

Conversation

snowystinger
Copy link
Member

Closes #850
This moves useInteractOutside to fire on mouse down instead of on up, this means menus won't reopen after they've been closed by the blur
It also takes advantage of shouldCloseOnInteractOutside, which lets us detect if the the interaction was on the trigger, which will automatically toggle the menu when clicked. If we couldn't filter that event out, then the menu would just be closed from outside interaction and toggled open again immediately
cleans up trigger toggle state so it always uses the latest state

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

This moves useInteractOutside to fire on mouse down instead of on up, this means menus won't reopen after they've been closed by the blur
It also takes advantage of shouldCloseOnInteractOutside, which lets us detect if the the interaction was on the trigger, which will automatically toggle the menu when clicked. If we couldn't filter that event out, then the menu would just be closed from outside interaction and toggled open again immediately
cleans up trigger toggle state so it always uses the latest state
@adobe-bot
Copy link

Build successful! 🎉

@snowystinger snowystinger changed the title Fix double open menu from main Fix double open menu Aug 12, 2020
@adobe-bot
Copy link

Build successful! 🎉

@dannify dannify merged commit 5098714 into main Aug 12, 2020
@dannify dannify deleted the fix-double-open-menu-from-main branch August 12, 2020 01:15
devongovett added a commit that referenced this pull request Aug 17, 2020
devongovett added a commit that referenced this pull request Aug 18, 2020
snowystinger added a commit that referenced this pull request Jan 22, 2021
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.

Duplicate menu open

3 participants