[1.0.0-rc3] Remove size attribute on input fields

Created on 2 May 2024, 7 months ago
Updated 24 June 2024, 5 months ago

Problem/Motivation

For accessibility reasons, the size attribute shouldn't be used on input elements (type text, search, url, tel, email, password) : this is a presentational attribute for the width, we should use CSS instead.

Steps to reproduce

When rendering a form (ex : search form in header), a size attribute is by default on the input tag.

Proposed resolution

Use a preprocess to remove size attribute on all input tags with type text, search, url, tel, email, or password.

As the structure of the search form is not exactly the same as in DSFR documentation, it also needs a little tweak in CSS to keep the visual OK :

.fr-search-bar .fr-input-group {
  flex-grow: 1;
}
✨ Feature request
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡«πŸ‡·France mh_nichts

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024