-
Notifications
You must be signed in to change notification settings - Fork 5
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
Use a ref for TargetName input instead of direct dom lookup #4399
Conversation
(_, inputRef) => | ||
inputRef.get | ||
.flatMap( | ||
_.foldMap(i => Callback(timers.setTimeout(50)(i.select()))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With a timeout of zero, this solution had about the same reliability as the previous one. That is to say, the input always got selected but sometimes the cursor was at the end of the field rather than selecting all of the text. With the 50ms delay it has worked every time I tried it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be done as Callback.delayMs(50)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure. delayMs
returns an AsyncCallback
which seemed harder to deal with. I'd have to turn it back into a Callback
.
BundleMonFiles updated (1)
Unchanged files (7)
Total files change +1.38KB +0.06% Final result: ✅ View report in BundleMon website ➡️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
f1c8ec9
to
ecb9eda
Compare
While working on an intractable story, I saw this comment and thought "hey, here's something I can atually fix!"