fix(editor): anchor selector dropdowns to the element's owner window#147
Merged
Conversation
- Anchors were built from EditorWindow.focusedWindow, but a click into an unfocused floating window dispatches its pointer event before focus moves, so the picker opened in the previous window's coordinate space - Add VisualElementExtensions.GetOwnerWindow() that resolves the EditorWindow whose panel hosts the element, falling back to focused/mouseOver window - Apply it in SerializeReferenceField (dropdown + fix selector), TypeField, IdField and the list "+" append picker Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
VPDPersonal
marked this pull request as ready for review
July 20, 2026 20:58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type/Id/SerializeReference selector dropdowns opened in the wrong screen position when the inspector was an unfocused floating window: anchors were built from
EditorWindow.focusedWindow, but UIToolkit dispatches the pointer event before focus moves, so the rect landed in the previously focused window's coordinate space (e.g. over the Project panel).VisualElementExtensions.GetOwnerWindow()— resolves theEditorWindowwhose panel actually hosts the element, falling back to focused/mouse-over window for detached elementsSerializeReferenceField(dropdown + fix selector),TypeField,IdField, and the list+append pickerVisualElementExtensions.md(EN/RU, Editor commands section)Notes for review
SerializeReferenceSharedNavigation.ScrollTointentionally keepsmouseOverWindow— it scrolls the window under the cursor, which is the correct semantics there🇷🇺 Описание на русском
Дропдауны селекторов Type/Id/SerializeReference открывались не в том месте экрана, когда инспектор был нефокусным плавающим окном: якорь строился от
EditorWindow.focusedWindow, но UIToolkit доставляет pointer-событие до переключения фокуса, поэтому прямоугольник оказывался в системе координат прежнего окна (например, поверх панели Project).VisualElementExtensions.GetOwnerWindow()— находитEditorWindow, чья панель реально содержит элемент, с откатом на focused/mouse-over окно для отсоединённых элементовSerializeReferenceField(дропдаун + Fix-селектор),TypeField,IdFieldи пикер кнопки+у списковVisualElementExtensions.md(EN/RU, раздел Editor commands)Заметки для ревью
SerializeReferenceSharedNavigation.ScrollToнамеренно оставлен наmouseOverWindow— там скроллится окно под курсором, это корректная семантика