Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report] Select option's list is not closing on click (on clicking icon also) when set to multiple and filterable #11048

Closed
akki-jat opened this issue May 7, 2018 · 9 comments

Comments

@akki-jat
Copy link
Contributor

akki-jat commented May 7, 2018

Element UI version

2.3.7

OS/Browsers version

Windows 7 / Chrome 66.0.3359.139

Vue version

2.5.11

Reproduction Link

https://codepen.io/akki-jat/pen/GdEYyG

Steps to reproduce

Open it then try to close it by clicking on select element

What is Expected?

Select option's list should be closed

What is actually happening?

Select option's list is not closing

@akki-jat
Copy link
Contributor Author

Hey @Leopoldthecoder, what about this, is it suppose to work like that?

@leslieSie
Copy link

I think you should remove the property of filterable or change another version,version on 2.3.9 fixed this problem

@leslieSie
Copy link

@Leopoldthecoder dalao close this problem

@akki-jat
Copy link
Contributor Author

akki-jat commented May 28, 2018

Hi @leslieSie, I need the filter functionality and this issue is not solved either in 2.3.9 or 2.4.0.
In new version, on pc it is closed only first time and second time it does not close & on mobile it even not closes first time.

And I updated codepen's element-ui to 2.3.9 for the same. If you want to replicate the issue

@wacky6
Copy link
Contributor

wacky6 commented Jun 4, 2018

The problem is that if you want filterable, there will be an input where you type things. Clicking on select's text area will focus the input, thus preventing dropdown from closing (because the component is expecting user to input something).

Suppose dropdown is closed as you requested, imagine the scenario where user is selecting inputted text with mouse, which triggers click thus closes the dropdown. I doubt this is an appropriate behavior for user-interaction.

If you do really need to do so, you can listen on native click event on select, then modify select's internal state.


The arrow (caret) implementation seems buggy now. I suppose you are talking about clicking that button fails to close dropdown?

@akki-jat
Copy link
Contributor Author

akki-jat commented Jun 5, 2018

Hi @wacky6, I also thought that.
But in example on website, it is working fine.

Take a look

http://element.eleme.io/#/en-US/component/select#option-filtering

@wacky6
Copy link
Contributor

wacky6 commented Jun 5, 2018

Well, in your case multiple is also used. My guess would be multiple somehow interferes with caret's click handler.

@akki-jat
Copy link
Contributor Author

akki-jat commented Jun 5, 2018

Yes, you are right @wacky6.

@akki-jat akki-jat changed the title [Bug Report] Select option's list is not closing on click when set to multiple and filterable [Bug Report] Select option's list is not closing on click (on clicking icon also) when set to multiple and filterable Jun 5, 2018
@ziyoung ziyoung closed this as completed Apr 2, 2019
@tripflex
Copy link

For those coming here wondering how to CLOSE the dropdown when using multiple on a select element (since it stays open by default) when someone selects a value, add a ref to the el-select item, then on @change method call that ref with the blur() method:

Like this:

<el-select ref="mySelectRef" v-model="myModel" multiple="multiple" @change="$refs.mySelectRef.blur()">
...
</el-select>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants