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

remove defaultProp from required property in components/modal #16074

Merged

Conversation

dsifford
Copy link
Contributor

closes #16062

Let me know if you have any further questions/comments.

@gziolo
Copy link
Member

gziolo commented Jun 10, 2019

I'm wondering whether we should update docs to reflect that it is optional instead. It seems to be safer.

@dsifford
Copy link
Contributor Author

That works too! Won't hurt my feelings to close this PR if that's the preferred route 😝

@dsifford
Copy link
Contributor Author

dsifford commented Jun 10, 2019

Though, I'm wondering if that will result in a component that renders with close buttons that aren't usable (or, rather, that when clicked don't do anything). Is that an a11y issue?

@aduth
Copy link
Member

aduth commented Jun 10, 2019

Though, I'm wondering if that will result in a component that renders with close buttons that aren't usable (or, rather, that when clicked don't do anything). Is that an a11y issue?

It would, and it is. Nothing really guarantees that a developer implementing onRequestClose would handle this appropriately, but it is expected that a developer should be using the prop to manage the closing of the modal (and as such, its existence is at least appropriate as a signal that it's being handled).

Reflecting on this, I think it would be perfectly reasonable to mark this prop as "Required". Normally I would be concerned about the backwards-compatibility impact of removing this default prop, but since it is explicitly documented as required, I think it would be fair to let this go through as proposed.

Copy link
Member

@aduth aduth left a comment

Choose a reason for hiding this comment

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

Per comments, I think this is an appropriate improvement. I'd wait to merge pending @gziolo's thoughts.

@gziolo
Copy link
Member

gziolo commented Jun 11, 2019

Per comments, I think this is an appropriate improvement.

Agreed, it will at least give some feedback when this prop isn't provided but the end effect will be the same. I didn't consider it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Modal component defines a defaultProp for a required property.
3 participants