Skip to content

Menu escape should not clear selection#4285

Merged
snowystinger merged 4 commits into
mainfrom
menu-escape
Apr 11, 2023
Merged

Menu escape should not clear selection#4285
snowystinger merged 4 commits into
mainfrom
menu-escape

Conversation

@snowystinger
Copy link
Copy Markdown
Member

@snowystinger snowystinger commented Mar 29, 2023

Closes #3987

✅ 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:

@rspbot
Copy link
Copy Markdown

rspbot commented Mar 29, 2023

@snowystinger snowystinger marked this pull request as ready for review March 31, 2023 22:50
@rspbot
Copy link
Copy Markdown

rspbot commented Mar 31, 2023

selectionManager: state.selectionManager,
collection: state.collection,
disabledKeys: state.disabledKeys,
preventEscapeClearsSelection: true,
Copy link
Copy Markdown
Member

@devongovett devongovett Apr 11, 2023

Choose a reason for hiding this comment

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

Now that I think about this, if menu is the only place where this is the case, we could consider overriding the keyboard handler and not forwarding escape instead of a new option.

Otherwise, this prop name doesn't really fit our pattern... disallowClearSelection or disallowEscape might be closer (like disallowEmptySelection and disallowSelectAll) but still sorta weird.

Copy link
Copy Markdown
Member Author

@snowystinger snowystinger Apr 11, 2023

Choose a reason for hiding this comment

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

I think I like not introducing a new prop for the moment more. If we find two+ instances where this is needed, then we could revisit adding it

@rspbot
Copy link
Copy Markdown

rspbot commented Apr 11, 2023

@rspbot
Copy link
Copy Markdown

rspbot commented Apr 11, 2023

@rspbot
Copy link
Copy Markdown

rspbot commented Apr 11, 2023

## API Changes

unknown top level export { type: 'identifier', name: 'Column' }
unknown top level export { type: 'identifier', name: 'Column' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }

Copy link
Copy Markdown
Member

@reidbarber reidbarber left a comment

Choose a reason for hiding this comment

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

LGTM

@snowystinger snowystinger merged commit 7f41c64 into main Apr 11, 2023
@snowystinger snowystinger deleted the menu-escape branch April 11, 2023 19:25
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.

Menu: In multiple selection mode, on pressing escape, all options are deselected.

4 participants