fix(input): improve clear button focus contrast by kavyansh18 · Pull Request #31428 · ionic-team/ionic-framework · GitHub
Skip to content

fix(input): improve clear button focus contrast - #31428

Open
kavyansh18 wants to merge 1 commit into
ionic-team:mainfrom
kavyansh18:fix/input-clear-icon-focus-contrast
Open

fix(input): improve clear button focus contrast#31428
kavyansh18 wants to merge 1 commit into
ionic-team:mainfrom
kavyansh18:fix/input-clear-icon-focus-contrast

Conversation

@kavyansh18

Copy link
Copy Markdown

Issue number: resolves #31141


What is the current behavior?

When an ion-input has clear-input enabled and the clear button receives keyboard focus, the clear button opacity is reduced to 0.5.

This makes the enabled clear button appear visually disabled when navigating to it using the keyboard. The reduced opacity also results in insufficient contrast for the clear button in its focused state.

The behavior comes from the .input-clear-icon:focus style in core/src/components/input/input.scss, which explicitly sets the opacity to 0.5.

What is the new behavior?

The clear button now retains full opacity when it receives keyboard focus.

The focused clear button opacity has been changed from 0.5 to 1, keeping the control visually consistent with its enabled state and improving its contrast when keyboard-focused.

A regression test has also been added to verify that:

  • The clear button can receive keyboard focus.
  • The clear button remains focused after keyboard navigation.
  • The clear button has an opacity of 1 when focused.

Does this introduce a breaking change?

  • Yes
  • No

This is a visual and accessibility-related bug fix only. No component APIs, properties, events, or existing interaction behavior have been changed.

Other information

The fix is limited to the existing focused-state opacity rule and a corresponding regression test.

No dependencies, configuration, component behavior, ARIA attributes, or other styles were changed.

The regression test passes across Mobile Chrome, Mobile Safari, and Mobile Firefox.

@kavyansh18
kavyansh18 requested a review from a team as a code owner September 5, 2026 14:16
@kavyansh18
kavyansh18 requested a review from thetaPC September 5, 2026 14:16
@vercel

vercel Bot commented Sep 5, 2026

Copy link
Copy Markdown

@github-actions github-actions Bot added the package: core @ionic/core package label Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: core @ionic/core package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: ion-input clear icon color does not have enough contrast upon focus using keyboard (accessibility issue)

1 participant