losing focus in search dialog #4587
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
We want to use code mirror ( version: 5.23.0.) as a web component. But in that scenario, the search dialog did not show up when pressing CTRL+F.
By instrumenting the code, we figured out that the dialog lost the focus and closed itself immediately after opening.
As a symptomatic fix in "addon/dialog/dialog.js" we delayed the focusing of the dialog so it did not lose its focus so quickly:
I tried to reproduce this with the code below, but the dialog seems to work fine inside a web component. Could you get me a minimal reproducing example of your problem?
I used your example to reproduce the issue in our context. I could track down the issue, that our component did not store the
shadowRootasrootas in the linethis.root = this.createShadowRoot();the property seemed is used by
activeElt...which let to confusion who should has the focus when the operation ended. Maybe it would be good to also look for "shadowRoot", because this was very hard to track down.
Ah, right, that should definitely use the
.shadowRootproperty, since.rootjust seems to be an accidental convention that happened to be used in any examples I saw so far. Attached patch changes this. Thanks for figuring that out.