Files
Floyd Wang f19f896fa1 popover: Fix race condition when restoring focus on close (#2189)
Follow-up to #2187.

When the popover closes, it previously always restored focus to the
previously focused element. This could cause a race condition: if
another element had already taken focus (e.g., a second popover
opening), the restore would incorrectly steal focus back.

Fix: only restore the previous focus handle if the popover's focus
handle still contains focus at the time of closing.

```diff
  if let Some(prev) = self.previous_focus_handle.take() {
+     if self.focus_handle.contains_focused(window, cx) {
          prev.focus(window, cx);
+     }
  }
```
2026-03-27 11:24:32 +00:00
..