vue-treeselect icon indicating copy to clipboard operation
vue-treeselect copied to clipboard

Create `closeOnBlur` option

Open mstratman opened this issue 5 years ago • 7 comments

Currently the menu always closes on blur: https://github.com/riophae/vue-treeselect/blob/d4943eb8287a5253516501f29326074b2038c434/src/components/Input.vue#L99

For mobile this can be a problem: 1. User taps treeselect, 2. keyboard opens, taking up half the display, 3. user scrolls to see bottom of list but the keyboard obscures it so they keep scrolling until the top of the treeselect leaves the viewport, causing a blur.

Idea: Add a closeOnBlur option, default true, and the line of code linked above would only execute if this this is true.

@riophae two questions:

  1. Would this have any adverse side-effects I'm not aware of? I.e. are there other scenarios that a 'blur' event may occur and we don't want to turn off the closing behavior in those scenarios?

  2. If no adverse side-effects, would you approve a pull request with this option? Any changes from my proposal you'd like to see?

mstratman avatar Sep 12 '19 01:09 mstratman

Note for future reference, if we go forward with this, it could possibly solve https://github.com/riophae/vue-treeselect/issues/284

mstratman avatar Sep 12 '19 01:09 mstratman

Hi! This is a great idea. Working on it.

riophae avatar Sep 12 '19 20:09 riophae

So no adverse side-effects or problems that could result by letting it remain open on blur?

If not, and if you'd prefer I'd be happy to add this and submit a pull.

mstratman avatar Sep 12 '19 20:09 mstratman

I'm not 100% sure about that. After a preliminary test, it seems to be practicable.

riophae avatar Sep 12 '19 20:09 riophae

Oh, I forgot to say that... PRs are welcome!

riophae avatar Sep 12 '19 20:09 riophae

has something been done for that ? I'm having that issue on mobile and it's annoying to not be able to close/hide the keyboard.

rhaamo avatar Nov 16 '20 09:11 rhaamo

@mstratman what's scheduling bro

iHadDream avatar Mar 06 '23 08:03 iHadDream