Skip to content

[InputBase] Fix text cutoff in High Contrast mode#48140

Closed
cyphercodes wants to merge 1 commit into
mui:masterfrom
cyphercodes:fix/textfield-high-contrast-cutoff
Closed

[InputBase] Fix text cutoff in High Contrast mode#48140
cyphercodes wants to merge 1 commit into
mui:masterfrom
cyphercodes:fix/textfield-high-contrast-cutoff

Conversation

@cyphercodes

Copy link
Copy Markdown

Summary

This PR fixes the text cutoff issue in TextField with variant="standard" when High Contrast mode is enabled (Windows accessibility feature).

Problem

In High Contrast mode, the text in Standard variant TextField gets cut off because the input has a fixed height of 1.4375em. In forced-colors mode, text metrics can differ slightly, causing the content to overflow.

Solution

Add a @media (forced-colors: active) media query to set height: auto with minHeight: 1.4375em instead of a fixed height. This ensures the input can grow if needed in High Contrast mode while maintaining the minimum expected height.

Changes

  • Added forced-colors media query in InputBaseInput styles

Issue

Fixes #47967

Testing

  • Verified the fix works in browser DevTools by enabling "Emulate CSS forced-colors: active"

Add media query for forced-colors mode to adjust input height
from fixed 1.4375em to auto with minHeight, preventing text
cutoff in Windows High Contrast mode and similar accessibility
settings.

Fixes mui#47967
@mui-bot

mui-bot commented Mar 29, 2026

Copy link
Copy Markdown

Netlify deploy preview

https://deploy-preview-48140--material-ui.netlify.app/

Bundle size report

Bundle Parsed size Gzip size
@mui/material 🔺+70B(+0.01%) 🔺+31B(+0.02%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes

Generated by 🚫 dangerJS against e3e1525

// Fix text cutoff in High Contrast mode
'@media (forced-colors: active)': {
height: 'auto',
minHeight: '1.4375em',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

From the issue it doesn't seem height is related

@silviuaavram

Copy link
Copy Markdown
Member

@cyphercodes check this comment #47967 (comment)

@mj12albert

Copy link
Copy Markdown
Member

Will be done in #48150

@mj12albert mj12albert closed this Mar 30, 2026
@zannager zannager added the scope: input Changes related to the input. label Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: input Changes related to the input.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Textfield Variant Standard cuts off text on High Contrast/Accessibility mode

5 participants