Skip to content

auto close dropdownlist when onSelect by mouse click #36

Open
@DoraemonYu

Description

@DoraemonYu

o(∩_∩)o Hello.

I found this problem when after I selected one opinion by mouse click, the dropdownlist would immediately show again.
However,if I selected the opinion by keyboard enter, it doesn't have this problem.
(target input still own FOCUS, but the former keep shown dropdownlist but the latter didn't. )

Then I compare the javascript logic between keydownHandler and mousedown ,
the former to close the dropdownlist by use: setTimeout(function(){ that.sc.style.display = 'none'; }, 20);
the latter to close the dropdownlist by use: that.sc.style.display = 'none';

So, I tried to modify the code to setTimeout(function(){ that.sc.style.display = 'none'; }, 200); in the mousedown handler , the problem I found would gone :)

BTW, as you notice ,Mmm....
I use 200ms instead of 20ms, because I was not sure why 20ms cannot fixed this issue but 200ms okay in mouse event. Does anybody have idea here?

Thanks so much :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions