Skip to content

[css-text-4] whitespace inside text areas #6309

Open
@atotic

Description

Inside <textarea>, browsers handle whitespace:normal differently:

Chrome silently replaces normal with pre-wrap. Edge used to do this too.
FF/Safari keep normal as is.

Having normal whitespace causes a non-WYSIWYG editing experience for the user. Spaces are not displayed as users type them, but they remain in DOM.

My opinion is that Chrome's behavior is desirable, because typing spaces and seeing nothing happen would be very confusing for the user, and the backend that receives a form with random white spacing that "looks good in the browser".

Does csswg have an opinion on what the right thing to do is?

Bugs:
Center and right justified text in textarea is not visually aligned properly.

Can't enter leading/trailing spaces in TEXTAREA with white-space:normal or nowrap

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions