WebKit Bugzilla
Attachment 360023 Details for
Bug 193775
: Calling focus() on a text field selects all of its contents
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Test case
focus-input.html (text/html), 677 bytes, created by
Wenson Hsieh
on 2019-01-24 11:41:12 PST
(
hide
)
Description:
Test case
Filename:
MIME Type:
Creator:
Wenson Hsieh
Created:
2019-01-24 11:41:12 PST
Size:
677 bytes
patch
obsolete
><!DOCTYPE html> ><html> > <head> > <meta name="viewport" content="width=device-width, initial-scale=1"> > <style> > input, body { > font-family: system-ui; > font-size: 20px; > } > </style> > </head> > <body> > <p id="select">Click here to focus the input.</p> > <input value="Hello world"></input> > <input type="submit" value="Blur"></input> > <script> > const select = document.getElementById("select"); > select.addEventListener("click", () => { > document.querySelector("input").focus(); > }); > </script> > </body> ></html>
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> input, body { font-family: system-ui; font-size: 20px; } </style> </head> <body> <p id="select">Click here to focus the input.</p> <input value="Hello world"></input> <input type="submit" value="Blur"></input> <script> const select = document.getElementById("select"); select.addEventListener("click", () => { document.querySelector("input").focus(); }); </script> </body> </html>
View Attachment As Raw
Actions:
View
Attachments on
bug 193775
: 360023