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

Prevents pillbox double insert in IE 11/Edge 14 #2023

Merged

Conversation

austin-rauschuber
Copy link

Fixes #2022

In IE11, the hide of $addItem causes on focusout event to be triggered. With the checks in this function it determines that:
A) If a focusout event has occurred
and B) There is text in the input box
then it should add a pillbox. Since the hide triggers a focusout event in IE11, entering text and pressing enter will get you to this line. It will then hide the item, triggering a blur event. Since the item still has text, the blur event will add it to the pillbox, then the enter event will also add it to the pillbox causing it to be double entered.

Setting the value to blank before hiding causes condition B to be invalidated whenever the function is called for the focusout event.

NOTE: No unit test was written for this as fuelux does not appear to contain a spy library such as sinon to evaluate that the val function is called before the hide function. Similarly, the behaviour in IE11 cannot be validated via unit test.

@aheile aheile merged commit f3b95ea into ExactTarget:master Oct 24, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants