pharos icon indicating copy to clipboard operation
pharos copied to clipboard

ToggleButton[Group]: Deprecate `selected` attribute before next major version

Open daneah opened this issue 3 years ago • 0 comments

The problem

The selected property and pressed properties serve very similar needs now, with one being used by the group component to keep track of the state and the other used to render the appropriate accessibility content into the underlying button element's DOM. selected never made its way all the way into the underlying button; it stops at ToggleButton very likely only need pressed now, as it should be able to serve both purposes.

The solution

Deprecate the selected property so that, when supplied, a warning log is emitted indicating the preferred usage of pressed.

Alternatives considered

We could have used selected to accomplish what we used pressed for, and keep it instead of moving forward with pressed. This has at least one drawback, to me, which is that selected shadows a built-in HTML5 attribute name and can confuse developers into thinking it works the same way when it comes to accessibility and programmatic access.

daneah avatar Nov 02 '22 00:11 daneah