Skip to content

fix: listen to opened-changed events in custom editors - #9671

Merged
web-padawan merged 6 commits into
mainfrom
fix/grid-pro/custom-editor-opened-changed
Jul 14, 2025
Merged

web-padawan merged 6 commits into
mainfrom
fix/grid-pro/custom-editor-opened-changed

Conversation

@DiegoCardoso

Copy link
Copy Markdown
Contributor

Description

This change adds an opened-changed listener for custom editors and checks that either the target element or its inputElement is focused. If not, then it calls the routine to stop the edit in the cell.

This is done for the case that a vaadin-date-picker is used as an editor and the user is interacting with the cell containing it in a device with a small viewport, like a phone. In this case, when the picker overlay is closed, the focus is not restored to the input, which should be the right time to remove the editor.

Part of #9158
Depends on #9670

Type of change

Bugfix

This change overrides the `focus` method to change how focus is handled
when the element is in fullscreen mode and it's focused. This is needed
to avoid the element being immediatelly removed by the Grid Pro when the
user is in a device with small viewport. The element receives focus, but
the `_onFocus` listener has a similar detection which removes the focus
from the input element, which causes the component to be removed from
the cell when used as a custom editor.

Part of #9158
This change adds a `opened-changed` listener for custom editors and
checks that either the target element or its `inputElement` is focused.
If not, then calls the routine to stop the edit in the cell.

This is done for the case a `vaadin-date-pikcer` is used as a editor and
the user is interacting with the cell containing it in a device with a
small viewport like a phone. In this case, when the picker overlay is
closed, the focus is not restored to the input, which should be a right
time to remove the editor.

Part of #9158
@DiegoCardoso
DiegoCardoso force-pushed the fix/grid-pro/custom-editor-opened-changed branch from 948b741 to 4f8fa1e Compare July 10, 2025 14:37
@DiegoCardoso
DiegoCardoso force-pushed the fix/grid-pro/custom-editor-opened-changed branch from 4f8fa1e to 1b19afd Compare July 10, 2025 14:38
Base automatically changed from refactor/date-picker/fullscreen-focus to main July 14, 2025 09:17
@sonarqubecloud

Copy link
Copy Markdown

@web-padawan
web-padawan merged commit a2dad47 into main Jul 14, 2025
@web-padawan
web-padawan deleted the fix/grid-pro/custom-editor-opened-changed branch July 14, 2025 10:52
@vaadin-bot

Copy link
Copy Markdown
Collaborator

Hi @DiegoCardoso and @web-padawan, when i performed cherry-pick to this commit to 24.7, i have encountered the following issue. Can you take a look and pick it manually?
Error Message:
Error: Command failed: git cherry-pick a2dad47
error: could not apply a2dad47... fix: listen to opened-changed events in custom editors (#9671)
hint: After resolving the conflicts, mark them with
hint: "git add/rm ", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

@vaadin-bot

Copy link
Copy Markdown
Collaborator

This ticket/PR has been released with Vaadin 25.0.0-alpha3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants