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

Useless Image reload triggered at keyup event, when cache is disabled #500

Open
enoh-barbu opened this issue Feb 13, 2024 · 7 comments
Open
Labels
GitHub Issues that have been added to our internal issue tracker. status: escalated

Comments

@enoh-barbu
Copy link

enoh-barbu commented Feb 13, 2024

Same bug described as here tinymce/tinymce-angular#138

https://stackblitz.com/edit/vitejs-vite-zwyxe1?file=src%2FApp.tsx

image
image

@danoaky-tiny
Copy link
Contributor

Could you please provide a code sandbox or a code snippet? I've tried replicating with the React integration, but I've only found this problem when deleting a selection of text, nothing with keyup events. And this can also be replicated in core TinyMCE, see this TinyMCE fiddle. In which case this would be an issue to do with core and not the React integration.

@danoaky-tiny danoaky-tiny added the needs: more info More information must be provided to make progress on this issue. label Feb 29, 2024
@enoh-barbu
Copy link
Author

enoh-barbu commented Feb 29, 2024

@danoaky-tiny I have updated my description, and after some debugging I found out that the bug can be reproduced if:

  1. codesample plugin is used
  2. onEditorChange is used
  3. disable cache setting in dev tookls is checked

Just go ahead on that example, paste/insert an image, and start typing in the editor

@danoaky-tiny
Copy link
Contributor

danoaky-tiny commented Mar 7, 2024

Internal ref: INT-3288

@danoaky-tiny danoaky-tiny added GitHub Issues that have been added to our internal issue tracker. and removed needs: more info More information must be provided to make progress on this issue. labels Mar 7, 2024
@danoaky-tiny
Copy link
Contributor

danoaky-tiny commented Mar 21, 2024

The problem is there's a required call to editor.getContent within onEditorChange, in order to supply the content for the callback. This is where the setup you provided will cause an image refetch.

If applicable, you could opt to use the editor as an uncontrolled component and call getContent when you need it.

Another solution that could work (depending on your use case) is to have something like a changeEvents prop added. This would be used to override the default list of events that onEditorChange fires on. So to fix this particular case, you'd want to not fire on the 'input' event.

Otherwise this would need to be addressed as a core TinyMCE issue. As it's replicable in a TinyMCE fiddle and in the Angular integration too, see: https://codesandbox.io/p/sandbox/int-3288-539h9p

@danoaky-tiny danoaky-tiny added the needs: more info More information must be provided to make progress on this issue. label Mar 22, 2024
@enoh-barbu
Copy link
Author

For now I just removed codesample plugin, as I don't use it at all

Copy link

This issue is stale because it has been open for 30 days with no activity. Respond with a comment or this will be closed in 7 days.

@github-actions github-actions bot added the status:stale An issue that has been left with no response for an extended period of time. label Apr 22, 2024
@enoh-barbu
Copy link
Author

Not sure what prio has this one, but I think it's still an issue which might need some attention, if possible

@github-actions github-actions bot removed the needs: more info More information must be provided to make progress on this issue. label Apr 23, 2024
@danoaky-tiny danoaky-tiny added status: escalated and removed status:stale An issue that has been left with no response for an extended period of time. labels Apr 29, 2024
@tinymce tinymce deleted a comment from tiny-stale-bot Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GitHub Issues that have been added to our internal issue tracker. status: escalated
Projects
None yet
Development

No branches or pull requests

2 participants