Skip to content

[Accessibility] Fix: turn File Input close into a button element #11327

Open
abrahammordev wants to merge 2 commits intoILIAS-eLearning:release_10from
surlabs:ilias10_a11y_M43963
Open

[Accessibility] Fix: turn File Input close into a button element #11327
abrahammordev wants to merge 2 commits intoILIAS-eLearning:release_10from
surlabs:ilias10_a11y_M43963

Conversation

@abrahammordev
Copy link
Contributor

File Input Close Button Accessibility Improvement

The close glyph used to remove selected files was implemented as an <a> element. This is not semantically correct and may cause accessibility and usability issues, as it does not convey the proper button behavior to assistive technologies.

This change replaces the with a proper <button> HTML element, ensuring better semantics, accessibility, and consistency with expected UI patterns.

Changes

Updated File Input component:

  • Replaced the <a> element used as a close/remove control with a <button> element
  • Improved semantic correctness and accessibility behavior

Updated FileInputTest:

  • Adjusted tests to reflect the new <button> markup
  • Added a helper method to dynamically generate the expected button HTML

Note

These changes required updates to existing tests to align with the new markup structure.

Related

@abrahammordev abrahammordev added css/html Pull requests that propose changes to CSS/SCSS or HTML files. accessibility Pull requests that propose A11Y changes. labels Mar 24, 2026
Copy link
Contributor

@thibsy thibsy left a comment

Choose a reason for hiding this comment

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

Hi @abrahammordev,

Very sorry for your spent work, but I think this and all other issue in regards of glyph components rendered as an <a> tag or missing role="img" attribute are fixed and superseded by #11260.

I leave this open until the other PR is fixed and we could verify the linked mantis issue here is addressed as well.

Kind regards,
@thibsy (as UI coordinator)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accessibility Pull requests that propose A11Y changes. css/html Pull requests that propose changes to CSS/SCSS or HTML files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants