Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: do not dispatch event on stopedit when editor loading #8232

Merged

Conversation

ugur-vaadin
Copy link
Contributor

@ugur-vaadin ugur-vaadin commented Nov 27, 2024

Description

When a slow custom editor is used, quickly tabbing through the cells can cause a false positive on cell value change since the editor value is not updated yet at that point. This leads to firing unnecessary item-property-changed events.

This PR adds an editor loading check in _stopEdit in order to avoid firing the events. This is effectively the same as canceling the edit.

Fixes #6816

Type of change

  • Bugfix
  • Feature

Checklist

  • I have read the contribution guide: https://vaadin.com/docs/latest/contributing/pr
  • I have added a description following the guideline.
  • The issue is created in the corresponding repository and I have referenced it.
  • I have added tests to ensure my change is effective and works as intended.
  • New and existing tests are passing locally with my change.
  • I have performed self-review and corrected misspellings.

@ugur-vaadin ugur-vaadin requested a review from vursen November 27, 2024 08:29
@ugur-vaadin ugur-vaadin marked this pull request as ready for review November 27, 2024 08:29
@tomivirkki
Copy link
Member

We should fix the underlying issue of the value being read directly from the web component instance with Flow Custom editors. The issue also manifests like this even when the editor is no longer loading:

Kapture.2024-11-27.at.10.47.54.mp4

Copy link
Member

@tomivirkki tomivirkki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We decided to treat the issue mentioned above as a separate topic. This change is overall an improvement to the current behavior and does fix what's described in vaadin/flow-components#6816 so let's merge it.

@ugur-vaadin ugur-vaadin removed the request for review from vursen November 29, 2024 08:54
@ugur-vaadin ugur-vaadin merged commit ea24ab2 into main Nov 29, 2024
9 checks passed
@ugur-vaadin ugur-vaadin deleted the fix-do-not-dispatch-event-on-stopedit-when-editor-loading branch November 29, 2024 09:01
@vaadin-bot
Copy link
Collaborator

Hi @ugur-vaadin and @ugur-vaadin, when i performed cherry-pick to this commit to 24.4, i have encountered the following issue. Can you take a look and pick it manually?
Error Message:
Error: Command failed: git cherry-pick ea24ab2
error: could not apply ea24ab2... fix: do not dispatch event on stopedit when editor loading (#8232)
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".

ugur-vaadin added a commit that referenced this pull request Nov 29, 2024
…8240)

Co-authored-by: Ugur Saglam <106508695+ugur-vaadin@users.noreply.github.com>
ugur-vaadin added a commit that referenced this pull request Dec 2, 2024
…P: 24.4) (#8246)

* fix: do not dispatch event on stopedit when editor loading (#8232) (CP 24.4)

* Trigger Build
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Vaadin 24.6.0.beta3 and is also targeting the upcoming stable 24.6.0 version.

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.

Tabbing GridPro cells with custom editor emits item property changes
3 participants