ember-power-select icon indicating copy to clipboard operation
ember-power-select copied to clipboard

Allow action to prevent focusing

Open Ramblurr opened this issue 9 years ago • 1 comments

The power-select-multiple component has several event handlers, e.g.,:

  • handleFocus
  • handleKeydown
  • handleOpen

All three allow custom actions, but only handleKeydown allows the action to prevent propagation of the event.

To be consistent handleFocus and handleOpen should have the same behavior.

The use case is in certain circumstances (when my complex itemComponent is clicked) I want to prevent the focusing of the input. On mobile the focus pops up the keyboard. I've handled onOpen in my component to blur the component, but on iOS the results in the on screen keyboard flickering as the input is focused then blurred.

Ramblurr avatar May 31 '16 14:05 Ramblurr

I'm in the middle of an important refactor of the internals of the component, so I'm going to park this for a while, but generally yes, I started to apply the pattern of returning false to prevent the default behaviour at some point and probably actions implemented before then still don't have that ability.

They should all be consistent. Bring the subject again next week once this mad refactor is finished.

cibernox avatar Jun 02 '16 23:06 cibernox