Skip to content

[A11y]: clickable elements inside controls are not available from keyboard#2845

Merged
AlekseyManetov merged 74 commits intodevelopfrom
fix/2719
Nov 19, 2025
Merged

[A11y]: clickable elements inside controls are not available from keyboard#2845
AlekseyManetov merged 74 commits intodevelopfrom
fix/2719

Conversation

@vasilii-kovalev
Copy link
Contributor

@vasilii-kovalev vasilii-kovalev commented Jun 3, 2025

Description

  • Make clear button and clickable icon accessible and operable via keyboard by turning them into IconButton-s. The following components are affected:
    • Date Picker
    • Range Date Picker
    • Search Input
    • Text Input
    • Time Picker
    • Picker Input
    • Tag (also covers tags in Picker Input with selectionMode="multiple")
  • Add hover and focus styles to the clear button and clickable icon where necessary
  • Create ControlIcon in uui-components and uui. Use them in TextInput, PickerToggler and Tag, and remove input-specific icon-related CSS variables
  • Change aria-label attribute's value for clear button to "Clear input" to match the one in TextInput
  • Icon set with icon property in TextInput (and other inputs that use it) is now always displayed in mode="cell", not only on hover
  • Remove unnecessary paddings/margins for clear button and clickable icon
  • Improvements in tests for TextInput component
    • Remove a duplicate test
    • Handle a null value in setupTextInput

Issue link

#2719

QA notes

@vasilii-kovalev vasilii-kovalev changed the base branch from main to develop June 3, 2025 10:58
@github-actions
Copy link

github-actions bot commented Jun 3, 2025

Generated by: track-bundle-size
Generated at: Wed, 19 Nov 2025 17:45:45 GMT
Bundle size diff (in kBytes). Not gzipped. Both CSS & JS included.
Baseline: v6.1.5-beta.1 (2025-07-15)
CI Status: ok

Module Baseline Size
(v6.1.5-beta.1)
Size Diff Within
Threshold
Threshold
(min - max)
templateApp 646.65 693.08 +46.43
js:+22.47
css:+23.96
🆗 581.98 - 711.31
@epam/app 5368.95 5584.66 +215.71
js:+191.58
css:+24.13
🆗 4832.06 - 5905.85
@epam/electric 5.03 5.04 +0.01
js:+0.01
css:0
🆗 4.53 - 5.54
@epam/promo 55.43 55.61 +0.18
js:+0.01
css:+0.18
🆗 49.89 - 60.97
@epam/uui-extra 0.21 0.21 0
js:0
css:0
🆗 0.19 - 0.23
@epam/loveship 92.62 92.82 +0.2
js:+0.02
css:+0.18
🆗 83.35 - 101.88
@epam/uui-components 251.75 257.23 +5.48
js:+5.11
css:+0.37
🆗 226.58 - 276.93
@epam/uui-core 325.46 324.39 -1.07
js:-1.07
css:0
🆗 292.92 - 358.01
@epam/uui-db 41.63 41.63 0
js:0
css:0
🆗 37.47 - 45.8
@epam/uui-docs 179.06 181.03 +1.97
js:+1.97
css:0
🆗 161.15 - 196.96
@epam/uui-editor 173.82 174.1 +0.28
js:+0.24
css:+0.04
🆗 156.44 - 191.2
@epam/uui-timeline 75.5 75.5 +0
js:+0
css:0
🆗 67.95 - 83.04
@epam/uui 503.4 527.53 +24.13
js:+17.5
css:+6.63
🆗 453.06 - 553.74
new sizes (raw)

To set the sizes as a new baseline, you can copy/paste next content to the uui-build/config/bundleSizeBaseLine.json and commit the file.

{
  "version": "6.3.1",
  "timestamp": "2025-11-19",
  "sizes": {
    "templateApp": {
      "css": 257464,
      "js": 452249
    },
    "@epam/app": {
      "css": 720507,
      "js": 4998185
    },
    "@epam/electric": {
      "css": 2275,
      "js": 2883
    },
    "@epam/promo": {
      "css": 47803,
      "js": 9145
    },
    "@epam/uui-extra": {
      "css": 0,
      "js": 213
    },
    "@epam/loveship": {
      "css": 55379,
      "js": 39666
    },
    "@epam/uui-components": {
      "css": 23598,
      "js": 239807
    },
    "@epam/uui-core": {
      "css": 0,
      "js": 332176
    },
    "@epam/uui-db": {
      "css": 0,
      "js": 42633
    },
    "@epam/uui-docs": {
      "css": 2156,
      "js": 183212
    },
    "@epam/uui-editor": {
      "css": 12953,
      "js": 165326
    },
    "@epam/uui-timeline": {
      "css": 2201,
      "js": 75109
    },
    "@epam/uui": {
      "css": 198734,
      "js": 341457
    }
  }
}

Generated by: generate-components-api
CI Status: ok

Total amount of exported types/props without JSDoc comments

Amount
Types 335 (+0) 🆗
Props 221 (+0) 🆗

@vasilii-kovalev
Copy link
Contributor Author

Currently, when focus is set to the clear buttons via keyboard, their color doesn't change like it would on hover or click. Let me know if it should be changed.

@vasilii-kovalev vasilii-kovalev self-assigned this Jun 3, 2025
@vasilii-kovalev vasilii-kovalev marked this pull request as ready for review June 3, 2025 11:32
@vasilii-kovalev
Copy link
Contributor Author

As far as I understand, the best practice would be also adding a live region, which would announce the clear button's appearance/disappearance (with a combination of the input's state), for screen reader users. I started to implement this, but the possible combination of cases looks too much for the case. For example, a simple use case with an initially empty text input:

  1. Initial state - not announcing anything
  2. Text appeared, clear button appeared - announce that the button appeared
  3. Text was cleared, clear button disappears - announce both facts
    To differ case 1 from 3, we would need a local state, and update it via useEffect.
    But what if the input has an initial value? The case 1 should be adjusted, and only the button's presence (not appearance, because it is initially there) should be announced.
    Plus, since it is necessary in two places (PickerToggler and TextInput), we'd better to move it to a separate component like ClearInputButtonLiveRegion, that would either accept input's value and contain the text management logic inside, or accept the appropriate text from outside, that should be managed in components, that use it. I wasn't able to find an appropriate spot in the project's structure for such a component.

If implementing of such a component is necessary, please let me know. But it will be necessary to decide, how to properly define its API and placement.

@vasilii-kovalev vasilii-kovalev marked this pull request as draft July 29, 2025 10:09
@vasilii-kovalev vasilii-kovalev marked this pull request as draft July 29, 2025 10:09
@vasilii-kovalev vasilii-kovalev marked this pull request as draft July 29, 2025 10:09
@vasilii-kovalev vasilii-kovalev marked this pull request as draft July 29, 2025 10:09
@vasilii-kovalev vasilii-kovalev marked this pull request as draft July 29, 2025 10:09
@vasilii-kovalev vasilii-kovalev marked this pull request as draft July 29, 2025 10:09
Vasilii Kovalev and others added 10 commits November 7, 2025 18:06
Also fixed multiple modal windows from opening for `editMode="modal"`
# Conflicts:
#	changelog.md
# Conflicts:
#	uui/components/pickers/__tests__/__snapshots__/PickerList.test.tsx.snap
#	uui/components/pickers/__tests__/__snapshots__/PickerModal.test.tsx.snap
@AlekseyManetov AlekseyManetov merged commit 579b676 into develop Nov 19, 2025
4 checks passed
@AlekseyManetov AlekseyManetov moved this to In testing in UUI Project Board Nov 19, 2025
@NatalliaAlieva NatalliaAlieva moved this from In testing to Ready to release in UUI Project Board Dec 11, 2025
@NatalliaAlieva NatalliaAlieva added this to the 6.4.0 milestone Dec 15, 2025
@NatalliaAlieva
Copy link
Collaborator

Released in 6.4.0 ver.

@NatalliaAlieva NatalliaAlieva moved this from Ready to release to Closed in UUI Project Board Dec 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

4 participants