Thanks to visit codestin.com
Credit goes to github.com

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

Indeterminate ngModel behavior when updateOn is blur #12455

Closed
@robmazan

Description

@robmazan

The example for the issue described here can be checked on CodePen.

Let's assume you have the following setup:

  • An input field with ngModel on it, having ng-model-options="{updateOn: 'blur'}"
  • A button with ngClick on it, where the handler function using the value of the model from scope

Executing the following steps has different results on mouse and on touch devices:

  • Edit the input value
  • Click on the button directly (without clicking anywhere else first)

With mouse based input the ngClick handler can access the current input value on scope, and it is the same value that you can see in the input field.

On touch devices however, when the ngClick handler is executed the value is not updated yet (see the CodePen example with Chrome DevTools device emulation to see it happening).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions