Wait for focus on iframe

This actually worsens the UX as you have to click
outside of the iframe to run the command a second
time to show the cli successfully.
This commit is contained in:
Oliver Blanthorn 2019-02-06 16:31:12 +00:00
parent 8ee8f1d1ec
commit 60b896f57c
No known key found for this signature in database
GPG key ID: 2BB8C36BB504BFF3

View file

@ -2468,11 +2468,11 @@ export async function sleep(time_ms: number) {
/** @hidden */
//#content
export function showcmdline(focus = true) {
CommandLineContent.show()
export async function showcmdline(focus = true) {
await CommandLineContent.show()
let done = Promise.resolve()
if (focus) {
CommandLineContent.focus()
await CommandLineContent.focus()
done = Messaging.messageOwnTab("commandline_frame", "focus")
}
return done
@ -2486,9 +2486,9 @@ export function hidecmdline() {
/** Set the current value of the commandline to string *with* a trailing space */
//#content
export function fillcmdline(...strarr: string[]) {
export async function fillcmdline(...strarr: string[]) {
let str = strarr.join(" ")
showcmdline()
await showcmdline()
return Messaging.messageOwnTab("commandline_frame", "fillcmdline", [str])
}