Search input closes immediately after focus
See original GitHub issueAfter upgrading to version version 3.0.4, I noticed a behaviour change in the application that I cant immediately figure out.
I have a component like this:
<PowerSelect
@class="search-input"
@searchMessage="Search"
@searchMessageComponent={{component "recently-viewed" recordSelected=(action "recentlyViewedRecordSelected")}}
@placeholder={{@placeholder}}
@search={{perform this.searchTask}}
@searchEnabled={{true}}
@onChange={{action "valueChanged"}}
@onFocus={{action "handleFocus"}}
@renderInPlace={{true}} as |model|>
<div class="search-result">
<div class="name">
{{model.name}}
</div>
<div class="type">
{{model.constructor.modelName}}
</div>
</div>
</PowerSelect>
On focus of the Component, I want to display a list of recently viewed records, which I could accomplish with @searchMessageComponent
(this does seem to be missing from the documentation, but is still in the codebase)
The issue i’m seeing now, is that:
- on focus, the component im trying to use is displayed and immediately closed.
- clicking power-select, and holding the mouse button down, keeps the component open, until release of the mouse button
- when manually opening the search input, through the public api (
element.actions.open();
) it works as it should.
I narrowed down the code that closes the addon to here: https://github.com/cibernox/ember-basic-dropdown/blob/b60127457821069cf288a7008c6ec2f787a69497/addon/components/basic-dropdown-content.js#L125
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:13 (3 by maintainers)
Top Results From Across the Web
Android keyboard closing on input focus - Stack Overflow
When the Android user in Chrome tap to fill a input on my form, the Keyboard appears but suddenly closes immediately. Not giving...
Read more >Enter file name search popup is not closing itself after losing ...
The focus is losing this "Enter file name"(Either textbox should be empty or typed textbox value shouldn't have any result) popup, but not...
Read more >Restoring ActiveElement Focus After A User-Interaction In ...
activeElement property to record which element triggered the modal. And then, when the user subsequently closes the modal window, we can call ....
Read more >Window: afterprint event - Web APIs - MDN Web Docs - Mozilla
The afterprint event is fired after the associated document has started printing or the print preview has been closed.
Read more >Understanding Flutter's keyboard focus system
Flutter comes with a focus system that directs the keyboard input to a ... The previouslyFocusedChild disposition will search the scope to find...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
same issue for me… some change how
did-insert
works? or events in general might be handled faster? looks like it thisdocument.addEventListener(this.rootEventType, this.handleRootMouseDown, true);
(inbasic-dropdown-content.js
) is called during theonMouseDown
event phase. So, afterwardsronMouseClick
gets invoked and runs that code and then closes it 😦 Adding a delay in the setup function would probably fix it (or after OnMouseClick/onMouseDown?)edit: just noticed this is in
basic dropdown
… edit: changed the eventType toclick
and now it works fineI just removed it in my css stylesheet
¯\_(ツ)_/¯