https://screencast.googleplex.com/cast/NjQzNjY1NzI5MjExNTk2OHxiODJkMjE2NS0wZAHi wenhu! I patched this CL and tested on the arm where the realbox stays open and I'm noticing the context menu is closing after first tab selection: https://screencast.googleplex.com/cast/NjUwMTUyODQ3ODE1NDc1MnwyYTk2NDc4Mi0wMg
we might be closing it when it shouldn't be closed.
nit: can you also add a screencast with context management disabled. thank you!!
if (rect.width === 0 && rect.height === 0 && rect.top === 0 &&
rect.left === 0) {
this.close();
return;
}if the position is gets set to (0,0), this would cause the menu to close even when it should stay open right?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Hi wenhu! I patched this CL and tested on the arm where the realbox stays open and I'm noticing the context menu is closing after first tab selection: https://screencast.googleplex.com/cast/NjUwMTUyODQ3ODE1NDc1MnwyYTk2NDc4Mi0wMg
we might be closing it when it shouldn't be closed.
Done
nit: can you also add a screencast with context management disabled. thank you!!
Done
if (rect.width === 0 && rect.height === 0 && rect.top === 0 &&
rect.left === 0) {
this.close();
return;
}if the position is gets set to (0,0), this would cause the menu to close even when it should stay open right?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
lgtm!! thanks for doing extra testing!
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
[Context-Input] Prevent context menu jumping during tab selection
When selecting tabs in the flyout, the context menu would previously
jump around the screen or momentarily teleport to (0,0).
This occurred because of two main reasons:
1. Tab selection updates `tabSuggestions` which previously triggered a full `showAt()` call instead of `reposition_()`. This discarded the menu's locked alignment configuration.
2. Measuring `getBoundingClientRect()` before browser layout completed
during Realbox-to-Composebox transitions returned all zeros (0,0).
This CL resolves the context menu positioning issues by:
- Enforcing alignment persistence: Prioritizing `reposition_()` over `showAt()` when `tabSuggestions` are updated and the flyout is open. This prevents directional flipping when tab lists re-order.
- Synchronizing with browser layout: Deferring the menu opening by one
animation frame (`requestAnimationFrame`) during container transitions to guarantee accurate physical dimension measurements.
- Adding layout safeguards: Aborting the positioning updates if the
anchor element's bounding client rect measures as exactly 0x0 (unlaid-out or detached DOM elements).
Before fix:
Bug is reproducible when realbox keeps menu open on tab select enabled
https://screencast.googleplex.com/cast/NTM4MTQxMDY5NjIwMDE5Mnw3MmNmYmQyYy1iNQ
After fix:
Screencast to verify fix realbox keeps menu open on tab select enabled
https://screencast.googleplex.com/cast/NTUwNjI1MjE0OTg4Mjg4MHw1NGJlMTVmNC1iNQ
Screencast to verify no side effect on Enabled/realbox closes menu on tab select enabled/disabled
https://screencast.googleplex.com/cast/NjA4MTQ4MTQ4MTkxMjMyMHw2NjkzN2MxYi04OQ
https://screencast.googleplex.com/cast/NTExODU5NzI5MzY3MDQwMHwxN2NkODU5ZC1hZA
https://screencast.googleplex.com/cast/NDYwNjkwODU0NjY3ODc4NHxlNmYzZjM0NC0zNw
Fixed: b:532192485
Change-Id: Icddc6c0c670594fe7134a6bfd71d1c2e8139786c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8061569
Commit-Queue: Wenhu Cheng <wen...@google.com>
Reviewed-by: Ananya Seelam <ananya...@google.com>
Cr-Commit-Position: refs/heads/main@{#1659039}
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |