Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 210c5c04a4a3c18e995dfeed81649a2e24696971
      
https://github.com/WebKit/WebKit/commit/210c5c04a4a3c18e995dfeed81649a2e24696971
  Author: Razvan Caliman <[email protected]>
  Date:   2026-04-24 (Fri, 24 Apr 2026)

  Changed paths:
    M Source/WebInspectorUI/UserInterface/Views/ScopeBar.js

  Log Message:
  -----------
  Web Inspector: Network: Filtering by resource type does not work after 
clearing a filter without matches
https://bugs.webkit.org/show_bug.cgi?id=313002
rdar://161570940

Reviewed by Qianlang Chen and Devin Rousso.

There is a re-entrancy issue with handling 
`ScopeBarItem.Event.SelectionChanged` events
in response to clearing filters in a `WI.ScopeBar` which contains a 
`WI.MultipleScopeBarItem`.

`WI.ScopeBar.prototype.resetToDefault()` sets `item.selected = false` on 
individual items,
which triggers `MultipleScopeBarItem.set selectedScopeBarItem(null)`. That 
setter
ignores the next selection change event with `_ignoreItemSelectedEvent = true`.

While still inside that setter, the `WI.ScopeBar._itemSelectionDidChange` 
handler sets
`_defaultItem.selected = true` which fires another 
`ScopeBarItem.Event.SelectionChanged`
for the default item. `WI.MultipleScopeBarItem._itemSelectionDidChange` handler 
for
that event returns early because `_ignoreItemSelectedEvent` is still `true`.

The `WI.MultipleScopeBarItem` never updates its internal state to reflect the 
default selection,
leaving `_selectedScopeBarItem` as `null` and the `"selected"` CSS class 
removed. This
causes the `<select>` dropdown within `WI.MultipleScopeBarItem` to become 
`display: none`
and stop responding to input.

To fix this, when `WI.ScopeBar._multipleItem` exists, use its 
`selectedScopeBarItem` setter
directly to switch to the default item. This atomically deselects the old item,
selects the new one, and keeps the `WI.MultipleScopeBarItem`'s internal state 
consistent.
`WI.ScopeBar`'s own `_ignoreItemSelectedEvent` flag suppresses the redundant 
`_itemSelectionDidChange`
handler during the operation.

* Source/WebInspectorUI/UserInterface/Views/ScopeBar.js:
(WI.ScopeBar.prototype.resetToDefault):

Canonical link: https://commits.webkit.org/311947@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to