zestia / ember-select-box

:capital_abcd: A faux select box for Ember apps
MIT License
64 stars 14 forks source link

Improvements to interacting with elements outside of the select box #28

Closed amk221 closed 4 years ago

amk221 commented 4 years ago

@onClickOutside was an early attempt at creating an action that could be used to close a select box when it was no longer being interacted with.

A better paradigm is to use focus events - this allows us to remove document event handlers - which were previously being used for monitoring clicks outside of select boxes.

The migration from @onClickOutside to @onFocusLeave retains the same behaviour as before, but has the added benefit that @onFocusLeave will also fire when tabbing to an element outside of the select box.