-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Refactor Radio family to become SelectGroup family #408
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Radio
and Checkbox
should either be separate components or we should name it something more generic. A radio control by its nature should only allow a single item in a list to be selected.
CHANGELOG.md
Outdated
@@ -2,6 +2,9 @@ | |||
|
|||
#### 1.0.8 (Unreleased) | |||
|
|||
- [#408](https://github.com/influxdata/clockface/pull/408): Refactor `RadioButton` to include either a checkbox or radio input under the hood to enable better interactions with HTML5 forms | |||
- [#408](https://github.com/influxdata/clockface/pull/408): Enable tab focus interactions to improve `RadioButton` accessibility |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome!
Part of a shift to use on
Based on feedback I made these changes:
|
Closes #403
Aiming to make
SelectGroup
play a little nicer with HTML5 forms by making it utilize HTML inputs under the hood so a form can parse its value. The family has been renamed to indicate that it can be used for multi-select as well as single-select.Changes
Radio
family toSelectGroup
to be more semanticRadioButton
toSelectGroupOption
Toggle
andSelectGroupOption
to be uncontrolled andreadonly
onClick
instead ofonChange
becauseonChange
on a checkbox/radio input has inconsistent behavior between browsersSpace
key instead ofEnter
to toggle state ofToggle
andSelectGroupOption
SelectGroupOption
to follow a similar pattern toToggle
<button />
it is now composed of<input />
and<label />
SelectGroupOption
can be of typeradio
(default) orcheckbox
SelectGroupOption
is now tab focusableid
prop ofSelectGroupOption
requiredSelectGroupOption
to look more disabledSelectGroup
documentation to explain the new component APIScreenshots
Checklist
Check all that apply