Skip to content

input[type=number] lays out 18px tall while text/email/search inputs with the same styles get full padding #925

Description

@luis-serrano-l

Version: blitz-dom 0.3.0-beta.2 (crates.io), viewport 1000×700, scale 1.

An <input type="number"> styled the same as its siblings lays out at 18 px tall while text, email and search inputs get 37.2 px (padding + line box), so a form's number field renders as a thin strip.

Repro

<!doctype html>
<style>
  body { font: 16px sans-serif }
  input { padding: .5rem .75rem; border: 1px solid #888; border-radius: 8px; font: inherit; width: 300px; display: block; margin: 8px }
</style>
<input type="text"   value="text">
<input type="number" value="42">
<input type="email"  value="a@b.c">
<input type="search" value="search">

BaseDocument::get_client_bounding_rect after resolve():

input height
text 37.2
number 18.0
email 37.2
search 37.2

Expected: all four the same height (Chrome/Firefox: identical boxes for this stylesheet).

Notes

layout/construct.rs sends "number" down the same create_text_editor(doc, id, false) path as "text", so the difference seems to come later (intrinsic size of the editor, or a UA rule); I did not find a type=number rule in assets/default.css.

Found while using Blitz as a headless test renderer for a server-rendered form component.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions