mirror of
https://github.com/livebook-dev/livebook.git
synced 2024-09-20 10:05:57 +08:00
Delay appearing input focus (#1001)
This commit is contained in:
parent
353e1f7889
commit
5cb0c68c41
|
@ -96,7 +96,12 @@ window.liveSocket = liveSocket;
|
|||
// Handling custom events dispatched with JS.dispatch/3
|
||||
|
||||
window.addEventListener("lb:focus", (event) => {
|
||||
event.target.focus();
|
||||
// The element may be about to show up via JS.show, which wraps the
|
||||
// change in requestAnimationFrame, so we do the same to make sure
|
||||
// the focus is applied only after we change the element visibility
|
||||
requestAnimationFrame(() => {
|
||||
event.target.focus();
|
||||
});
|
||||
});
|
||||
|
||||
window.addEventListener("lb:set_value", (event) => {
|
||||
|
|
Loading…
Reference in a new issue