PolymerElements / iron-input

An input with data binding
https://webcomponents.org/element/PolymerElements/iron-input
33 stars 45 forks source link

type="number" prevent text input #121

Closed kuenstl closed 6 years ago

kuenstl commented 6 years ago

Description

The iron-input does prevent the user to enter text into the <iron-input> when type="number.

Expected outcome

The iron-input does prevent the user to enter text into the <iron-input> when type="number.

Actual outcome

The iron-input does prevent the user to enter text into the <iron-input> when type="number.

image

Live Demo

See second example on: webcomponents.org demo page

Steps to reproduce

  1. Put a iron-input element in the page.
  2. Set type="number" to the iron-input
  3. Open the page in a web browser (Firefox or Edge).
  4. Enter some text (non-numeric)
  5. The iron-input does not prevent the user to enter text (text is displayed - different behavior as in Chrome)

Browsers Affected

kuenstl commented 6 years ago

Here iron-input-html Line 302, the type and allowedPattern are checked onKeyPress. Both properties are undefined in the demo page of iron-input.