Closed
Bug 1940057
Opened 1 year ago
Closed 1 year ago
Replase `Services.focus.setFocus` with `Element#focus` in `MarkupContainer#focus`
Categories
(DevTools :: Inspector, task)
DevTools
Inspector
Tracking
(firefox136 fixed)
RESOLVED
FIXED
136 Branch
| Tracking | Status | |
|---|---|---|
| firefox136 | --- | fixed |
People
(Reporter: nchevobbe, Assigned: nchevobbe)
Details
Attachments
(1 file)
// When focus is coming from a mouse event:
// - prevent :focus-visible to be applied to the element
// - don't scroll element into view, as this could change the horizontal scroll,
// and the element is already visible since the user clicked on it.
Services.focus.setFocus(
focusable,
Services.focus.FLAG_NOSHOWRING | Services.focus.FLAG_NOSCROLL
);
We were using Services.focus.setFocus so we wouldn't scroll and avoid setting the focus visible style, but those are available in regular Element#focus (see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#preventscroll)
Let's use those directly since this is a bit more straightforward
| Assignee | ||
Comment 1•1 year ago
|
||
The option we were using are available natively, so let's use that.
Updated•1 year ago
|
Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/410b04cae735
[devtools] Replace Services.focus.setFocus with Element#focus in MarkupContainer#focus. r=ochameau,devtools-reviewers.
Comment 3•1 year ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
status-firefox136:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 136 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•