angular-multi-select icon indicating copy to clipboard operation
angular-multi-select copied to clipboard

How to make checkboxLayer locked to screen, so it won't close when lose focus

Open ghost opened this issue 8 years ago • 2 comments

I attached on-select-all callback which opens modal popup with overlay. It's z-index is higher than 999, because checkboxLayer has z-index: 999, and modal must be first at the stack order. But when I click on modal container, i.e. text of modal, the checkboxLayer losts its focus and closes. Any ideas, how could I prevent this behaviour?

ghost avatar May 10 '17 12:05 ghost

@aryniec ,

You'll need to modify the code, specifically on the function "externalClickListener".

IMO, the flow roughly would be like this:

  1. Most likely you need to pass an extra parameter into the directive, say the modal ID or modal class name.
  2. In that externalClickListener function, do a checking: if the click happens on that modal (by modal ID or by class name from step 1 above), then don't close the directive.

isteven avatar May 10 '17 13:05 isteven

@isteven,

Isn't that function "externalClickListener" already prepared for it: https://github.com/isteven/angular-multi-select/blob/master/isteven-multi-select.js#L689

there's argument 'e' which is used in loop, and checks if any element from looped dom elements is same as this we clicked on. Shouldn't this do the job?

ghost avatar May 10 '17 16:05 ghost