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

Custom field parts do not trigger custom field value change on 'setValue'. #1853

Open
stefanuebe opened this issue Jan 20, 2025 · 3 comments
Labels

Comments

@stefanuebe
Copy link

We have a date time picker built using a custom field (basically the sample from the "old" Flow days). While the normal usage works fine, the custom field has problems, when testbench tries to set values, for instance changing the "date" of the date picker part.

The problem seems to be, that the way how the value is set on the client does not trigger the "change" event (setProperty("value", newValue), which most fields use).

As a workaround I manually dispatch the respective event, but it would be good, that either the testbench element modify the value in a more "user like" way, to that events are fired correctly or the custom field change event should be fired, when the value property of one of its parts is changed.

dispatchEvent("change");

(depending on the solution this issue might be something for the web-components repo issue list)

@stefanuebe
Copy link
Author

stefanuebe commented Jan 20, 2025

If none of the above is doable, the custom field element docs should at least mention this problem and the element should provide a convenience method to fire that event, e.g.

/**
 * By default, a custom field does not recognize by default, when one of its elements update its value. This method will notify
 * the server to update its internal "full" value.
 */
public void notifyValueChange() {
    dispatchEvent("change");
}

@mshabarov
Copy link
Contributor

This may be a deviation between latest component implementation and TestBench, e.g. event, id, class names, etc.

@mshabarov
Copy link
Contributor

Do you have an example with which we can test?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 🔖 Normal Priority (P2)
Development

No branches or pull requests

2 participants