Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

fix(input): determine input[type=number] validity with ValidityState #4293

Closed
wants to merge 1 commit into from

Commits on Oct 20, 2013

  1. fix(input): determine input[type=number] validity with ValidityState

    On Chromium / Safari / Opera, currently:
    
    When a non-numeric string is entered into an input[type=number], the browser
    reports the value and innerText as the empty string.
    
    Without the ngRequire directive, the empty string is considered a valid value.
    
    This leads to false-positives.
    
    The aim of this patch is to suppress these false positives on browsers which
    implement the `ValidityState` object. Input directives may subscribe to check
    for `ValidityState` changes, and use the ValidityState during their processing.
    
    This allows the differentiation between "valid" and "invalid" empty strings.
    
    Closes angular#2144
    Caitlin Potter committed Oct 20, 2013
    Configuration menu
    Copy the full SHA
    e2da8b0 View commit details
    Browse the repository at this point in the history