calling this.blur() in onfocus handler or this.focus() in an onblur handler do not work
Categories
(Core :: DOM: UI Events & Focus Handling, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox141 | --- | fixed |
People
(Reporter: dlord, Assigned: edgar)
References
(Blocks 1 open bug)
Details
(Keywords: testcase, topembed-, Whiteboard: [eapp][see comment 34 for workaround][wanted2.1?], [wptsync upstream])
Attachments
(9 files)
893 bytes,
text/html
|
Details | |
1.68 KB,
text/html
|
Details | |
775 bytes,
text/html
|
Details | |
772 bytes,
text/html
|
Details | |
881 bytes,
text/html
|
Details | |
878 bytes,
text/html
|
Details | |
1.53 KB,
text/html
|
Details | |
5.40 KB,
patch
|
john
:
review+
roc
:
superreview+
|
Details | Diff | Splinter Review |
48 bytes,
text/x-phabricator-request
|
Details | Review |
Comment 1•25 years ago
|
||
Comment 2•25 years ago
|
||
Comment 4•25 years ago
|
||
Comment 5•25 years ago
|
||
Comment 7•25 years ago
|
||
Comment 8•25 years ago
|
||
Comment 9•25 years ago
|
||
Updated•25 years ago
|
Comment 10•24 years ago
|
||
Comment 11•24 years ago
|
||
Comment 14•23 years ago
|
||
Comment 15•23 years ago
|
||
Comment 16•23 years ago
|
||
Comment 17•23 years ago
|
||
Comment 18•23 years ago
|
||
Comment 20•23 years ago
|
||
Updated•23 years ago
|
Comment 21•23 years ago
|
||
Updated•23 years ago
|
Comment 22•23 years ago
|
||
![]() |
||
Comment 23•23 years ago
|
||
Comment 24•23 years ago
|
||
Comment 25•23 years ago
|
||
Comment 26•23 years ago
|
||
Comment 27•23 years ago
|
||
Comment 29•23 years ago
|
||
Comment 30•23 years ago
|
||
Reporter | ||
Comment 31•23 years ago
|
||
Comment 33•23 years ago
|
||
Comment 34•23 years ago
|
||
Comment 35•23 years ago
|
||
Updated•23 years ago
|
![]() |
||
Comment 36•23 years ago
|
||
Comment 37•23 years ago
|
||
![]() |
||
Comment 38•23 years ago
|
||
Comment 39•23 years ago
|
||
Comment 41•23 years ago
|
||
Comment 42•23 years ago
|
||
Comment 43•23 years ago
|
||
Comment 44•22 years ago
|
||
Updated•22 years ago
|
![]() |
||
Comment 45•22 years ago
|
||
Comment 46•22 years ago
|
||
Comment 47•22 years ago
|
||
![]() |
||
Comment 48•22 years ago
|
||
![]() |
||
Updated•22 years ago
|
Comment 49•22 years ago
|
||
Comment 50•22 years ago
|
||
Updated•22 years ago
|
Comment 52•22 years ago
|
||
Updated•22 years ago
|
Updated•22 years ago
|
Comment 54•22 years ago
|
||
Comment 55•22 years ago
|
||
Comment 56•22 years ago
|
||
Comment 57•22 years ago
|
||
Comment 58•22 years ago
|
||
Updated•22 years ago
|
Comment 59•22 years ago
|
||
Comment 60•22 years ago
|
||
Comment 61•22 years ago
|
||
Comment 62•22 years ago
|
||
Comment 63•21 years ago
|
||
Comment 64•21 years ago
|
||
Comment 65•21 years ago
|
||
Comment 66•21 years ago
|
||
Comment 67•21 years ago
|
||
Comment 68•21 years ago
|
||
Updated•21 years ago
|
Comment 69•21 years ago
|
||
Comment 70•20 years ago
|
||
Comment 71•20 years ago
|
||
Updated•19 years ago
|
Comment 72•18 years ago
|
||
Comment 73•18 years ago
|
||
Comment 74•18 years ago
|
||
Comment 75•18 years ago
|
||
Comment 76•18 years ago
|
||
Comment 77•18 years ago
|
||
Comment 78•18 years ago
|
||
Comment 79•18 years ago
|
||
Updated•17 years ago
|
Comment 82•17 years ago
|
||
Comment 84•17 years ago
|
||
Comment 85•17 years ago
|
||
Comment 86•17 years ago
|
||
Comment 87•17 years ago
|
||
Comment 89•17 years ago
|
||
Updated•16 years ago
|
Comment 90•16 years ago
|
||
Comment 91•15 years ago
|
||
Updated•15 years ago
|
Comment 93•15 years ago
|
||
Comment 94•15 years ago
|
||
Comment 95•15 years ago
|
||
Comment 96•15 years ago
|
||
Comment 97•15 years ago
|
||
Comment 98•14 years ago
|
||
Comment 99•14 years ago
|
||
Comment 101•14 years ago
|
||
Comment 102•14 years ago
|
||
Comment 103•14 years ago
|
||
Comment 104•14 years ago
|
||
Comment 105•14 years ago
|
||
Comment 107•13 years ago
|
||
Comment 109•13 years ago
|
||
Comment 110•13 years ago
|
||
Comment 111•7 years ago
|
||
Comment 112•7 years ago
|
||
Updated•6 years ago
|
Comment hidden (off-topic) |
Updated•3 years ago
|
Comment 114•2 years ago
|
||
This bug seems to be back for me. I can not use on focus on input date anymore (I have to click the calendar icon to make the pop-up show) since the last update!
Comment 115•2 years ago
|
||
(In reply to seularts from comment #114)
This bug seems to be back for me. I can not use on focus on input date anymore (I have to click the calendar icon to make the pop-up show) since the last update!
This bug is not fixed ("Status: NEW" is slightly confusing for a 23 years old issue ...)
So did anything change recently?
Comment 116•2 years ago
|
||
Please file a new bug for the issue you are seeing. There were changes to the datetime picker in Firefox 109 that are more likely to be related to the problem you're seeing rather than this bug which is 23 years old :)
Comment 117•2 months ago
|
||
Still an issue.
But my question is, is this actually a bug or just a gray area in specification?
https://codepen.io/stan-stan/pen/WbbzbMa?editors=1111
<div id="container">
<input id="text-input" type="text" placeholder="1st click" />
<button id="button">2nd click</click>
</div>
<br><br><br>
<details>
<summary>Edge, Firefox, and Jest Versions Tested On</summary>
<pre>
Microsoft Edge for Business
Version 135.0.3179.98 (Official build) (64-bit)
Firefox Developer Edition
139.0b2 (64-bit)
Note: Used custom react component to test, (not this exact code) in Jest and Jest exhibits same behavior as Firefox.
Jest
"jest": "^29.7.0",
"jest-css-modules-transform": "^4.4.2",
"jest-dom": "^4.0.0",
"jest-environment-jsdom": "^29.7.0",
"jsdom-testing-mocks": "^1.13.1",
"ts-jest": "^29.2.6",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.2.0",
"@testing-library/user-event": "^14.6.1",
</pre>
</details>
html {
font-size: 24px;
}
*:focus {
outline: red 2px solid;
}
const textInput = document.getElementById('text-input')
const button = document.getElementById('button')
textInput.addEventListener('focus', (event) => {
console.log(`${document.activeElement.id} got focus`)
})
button.addEventListener('focus', (event) => {
console.log(`${document.activeElement.id} got focus`)
})
textInput.addEventListener('blur', (event) => {
console.log(`${textInput.id} blurred`)
console.log('trying to move focus immediately back to text-input')
textInput.focus()
})
button.addEventListener('mousedown', function (event) {
console.log(`${this.id} mouse down`)
})
Assignee | ||
Comment 118•1 month ago
|
||
The use of mFirstBlurEvent
prevents a behavior where calling focus()
again
synchronously on the same element, after the focus has moved away, becomes a
no-op. Spec doesn't have such restriction and other browsers allow the element
to get focus again in this scenario.
A similar check, mFirstFocusEvent
, was removed in bug 1955225, and no
regressions have been reported since. I think we could try removing
mFirstBlurEvent
as well.
Updated•1 month ago
|
Comment 119•29 days ago
|
||
Comment 120•28 days ago
|
||
bugherder |
Updated•13 days ago
|
Description
•