Simplified markup for checkbox, radio, range, and toggle #25660
Locked
liamdebeasi
announced in
Approved RFCs
Replies: 1 comment
-
Hi everyone, Thank you for your feedback on this RFC! We will be moving forward with this proposed change in an upcoming release of Ionic Framework. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Definitions
Impacted Components:
ion-checkbox
,ion-radio
,ion-range
,ion-toggle
Form Control/Form Component: A single impacted component such as
ion-checkbox
orion-toggle
.Summary
We would like to make the following changes to the impacted components:
ion-item
onto the appropriate form components.ion-item
code.Motivation
Form components in Ionic are impacted by multiple issues:
Screen readers announce form controls twice. Axe also warns of "nested form interactive" errors:
bug: axe DevTools reports several items as "not announced by screen reader" #23511
bug: Checkbox touch target issue when there is a link in the text - A11y issue #23289
bug: adding aria labels to host and input element inside shadow root causes issues with nvda #23213
bug: AXE: Elements must use only allowed ARIA attributes for ion-select #22715
Form components are tightly coupled with
ion-item
leading to unexpected behaviors:bug: Angular ion-item combined with stacked ion-label loses item-label-stacked class once ion-chip is added #24312
bug: ion-chip is disabled when ion-input is disabled when both are in same ion-item #23331
bug: Ion-input is broken with 4.7.x #19084
bug: ion-label inside ion-item aligns wrongly or disappers if custom Angular component is used in this ion-item when stacked or floating position is set #22736
bug: ion-button inside of an ion-label not clickable in v6 #24215
bug: delegatesFocus patch for ios causes rendering issues with item sliding in chrome #25273
Form component usage is verbose and requires both
ion-item
andion-label
in order to behavior correctly.Proposed Design
We would like to move all form component APIs from
ion-item
onto the form components themselves. The following changes will be made:aria-label
to ensure the form control remains accessible.The following image highlights how the label placement and justification features can be used:
Old Usage:
New Usage:
Notable Changes:
ion-item
andion-label
are no longer used.label-placement
property displays the label after the radio (as opposed to before the radio).justify
property packs both the label and the radio at the start of the line.Benefits
ion-item
, allowing the Ionic team to provide for a more predictable user experience.Drawbacks
Migration Path and Breaking Changes
This change would ship in Ionic 7.0 at the earliest. We would like to support both the old usage and the new usage for the entire Ionic 7 lifecycle. This will allow developers to migrate their form components at their own pace. It will also reduce the barrier to upgrading to Ionic 7.0.
The following features will be deprecated in Ionic 7.0:
helper
anderror
slots onion-item
Note: We do not plan to make any breaking changes in Ionic 7.0 as a result of this proposal.
The following features will be removed in Ionic 8.0 at the earliest:
helper
anderror
slots onion-item
ion-item
Beta Was this translation helpful? Give feedback.
All reactions