Skip to content
This repository has been archived by the owner on Oct 19, 2021. It is now read-only.

feat(ComposedModal): support selectorPrimaryFocus prop #1634

Conversation

emyarod
Copy link
Member

@emyarod emyarod commented Dec 11, 2018

Closes IBM/carbon-components-react#1623

This PR adds support for the selectorPrimaryFocus prop on <ComposedModal> to match <Modal> and <ModalWrapper>

Related: #980 #1124 #1621 #1633

Changelog

New

  • focus management methods (many shared with <Modal>)
  • pass ref for primary focusable element to <ComposedModal>s using <ModalFooter>
  • storybook example <ComposedModal> with trigger button

Changed

  • declare <Modal> methods before they are called

@netlify
Copy link

netlify bot commented Dec 11, 2018

Deploy preview for carbon-components-react ready!

Built with commit 972a500

https://deploy-preview-1634--carbon-components-react.netlify.com

@joshblack
Copy link
Contributor

Related to focus, would we ever want to have our patterns follow what we do in UI Shell:

https://github.com/IBM/carbon-components-react/blob/fb398145c254117c915d1184b8baed0e638c133c/src/components/UIShell/HeaderMenu.js#L246-L262

e.g. basically make it so that children need to support a ref prop and we use that reference on the first item to focus the node.

Copy link
Contributor

@asudoh asudoh left a comment

Choose a reason for hiding this comment

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

Great effort getting two flavors of modals in sync @emyarod! Great if some tests can be added - Thanks!

@emyarod emyarod force-pushed the 1623-composedmodal-selectorprimaryfocus branch from 1aa4fe5 to 368bf79 Compare December 12, 2018 19:12
@emyarod
Copy link
Member Author

emyarod commented Dec 12, 2018

sure, I have updated with some test cases for selectorPrimaryFocus @asudoh

@asudoh
Copy link
Contributor

asudoh commented Dec 13, 2018

Thanks you for adding the tests @emyarod!

@asudoh asudoh merged commit 9ef4bdb into carbon-design-system:master Dec 13, 2018
@carbon-bot
Copy link

🎉 This PR is included in version 6.61.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@emyarod emyarod deleted the 1623-composedmodal-selectorprimaryfocus branch December 13, 2018 16:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants