0

I am using angular 1.5. I see the class names of textbox is getting changed to ng-not-empty-add, .ng-dirty-add, .ng-valid-parse-add and .ng-valid-add when the text box is populated with handheld devices. I don't see -add when populated with keyboard.

So my question is 1.What is this -add 2.Can I use this -add to differentiate between handheld and keyboard device entry 3.Or is their any other approach to differentiate handheld and keyboard input(I don't want to use time-based and prefix-based approaches)

I observed the following on debugger mode during keypress event

Handheld Device currentTarget: input#Number.ng-pristine.ng-empty.ng-invalid.ng-invalid-required.ng-valid-pattern.ng-valid-maxlength.ng-touched.ng-not-empty-add.ng-pristine-remove.ng-dirty-add.ng-valid-parse-add.ng-valid-add.ng-invalid-remove.ng-valid-required-add.ng-invalid-required-remove

Keyboard Device currentTarget: input#Number.ng-valid-pattern.ng-valid-maxlength.ng-touched.ng-not-empty.ng-dirty.ng-valid-parse.ng-valid.ng-valid-required

Thanks in advance

1 Answer 1

0

I found answer for this. The - add is because of animation function. The handheld device calls animation while inserting the textbox. So I added a listener for $animate and using it to differentiate handheld device and keyboard.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.