Skip to content

Contrast Error “Background Color Cannot Be Determined” on Textarea #4947

@Karthikeyan-mallow

Description

@Karthikeyan-mallow

Product

axe-core

Product Version

No response

Latest Version

  • I have tested the issue with the latest version of the product

Issue Description

Expectation

The accessibility scanner should correctly detect the background color of the <textarea> element and validate color contrast according to WCAG 2.1/2.2 guidelines. No contrast error should be raised when the textarea has a valid text and background color.

Actual

The tool reports a false positive error:

“Element's background color could not be determined because it's partially obscured by another element.”

This happens even though:

There are no overlapping elements in the layout.

The issue occurs even when testing a standalone <textarea> with no other HTML elements.

Manual WCAG contrast testing shows the textarea meets the required contrast ratio.

How to Reproduce

Use the following minimal code snippet:

<textarea style="color: #000; background-color: #fff;"></textarea>

Run any automated accessibility scanner (e.g., Axe, WAVE, Chrome Lighthouse).
The tool incorrectly flags the textarea with the error:
“Background color could not be determined because it's partially obscured.”

Additional Context

This appears to be a known false positive in certain WCAG scanning tools when analyzing form controls, especially <textarea>.

Multiple tests confirmed consistent false positives regardless of styling.

Manual inspection validates that the component passes WCAG contrast requirements, so this may be a scanner limitation rather than an actual issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    color contrastColor contrast issuesfixBug fixesrule metadataIssues in the rule metadata code (lib/rules)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions