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

updateValue() not called on content change when wrapped in aCustomField #30

Open
SonReimer opened this issue Jan 23, 2024 · 6 comments
Open

Comments

@SonReimer
Copy link

When putting TinyMce in a CustomField to add some feature like label, tooltip etc.,
someone has to add a ValueChangeListener to TineMce calling CustomField.updateValue() to propagate values from TinyMce to CustomField.
This is not intuitive and differs from the documentation of CustomField (see comments from Martin Vysny)
I think this is because client side throws a tchange event instead of change !?!
TinyMce 4.1.3/Vaadin 24.3.2

@SonReimer SonReimer changed the title Value propagation in a custom field does not work updateValue() not called on content change when wrapped in aCustomField Jan 23, 2024
@mstahv
Copy link
Collaborator

mstahv commented Jan 25, 2024

Do you have a code snippet available that could be used to reproduce the issue?

@SonReimer
Copy link
Author

SonReimer commented Jan 26, 2024

Here it is:
If you remove the ValueChangeListener in TineMceField.java:10, user changes in the editor will not be shown in Notification when closing.
MainView.java.txt
TinyMceField.java.txt

mstahv added a commit that referenced this issue Feb 1, 2024
@mstahv
Copy link
Collaborator

mstahv commented Feb 1, 2024

Verified.

But I gotta say I'm quite surprised by the behaviour of CustomField. This described behaviour seems to depend on propagated change events withtin the custom field (that might contain a dozen of fields). I'd even go as far as claiming that it is a bug, as it might easily be there are obsolete value changes and unexpected side effects now happening. Consider some custom field having a filtering input -> there will be a ton of extra traffic and JVM execution. Might even explains some weird behaviour I recently had in one of my apps, but didn't debug further...

If/as the workaround is so simple, I'll leave this open for now before investigating further.

And cheers to @mvysny !

On a related topics. Whic are all field features you'd like? tooltip and label mentioned.

@mstahv
Copy link
Collaborator

mstahv commented Feb 1, 2024

Checked that at least the #28 is again broken if wrapped in CustomField (yet another webcomponent). I'd suspect that is somethign related to Dialog not to this component, similar hack to CustomField might do it 🤷‍♂️ Maybe it would be easier to implement those features directly to this component, not sure.

@SonReimer
Copy link
Author

I think label and tooltip are sufficient. From my point of view placeholder and helper do not really make sense.

@SonReimer
Copy link
Author

Using the mentioned workaround for updateValue() is sufficient for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants