eclipsesource / eclipsesource/jsonforms

[renderers] Possibility to choose whether `onChange` is triggered at each typed character or on focus loss for text-based inputs

Open
#1,905 7 comments 4 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
2.7k
Forks
424
Avg merge
17d 8h
Merged PRs (30d)
1

Description

### Is your feature request related to a problem? Please describe.

Currently (at least with Material UI renderer and I think also with vanilla React renderer), the `onChange` method is called each time a character is typed in the text-based input (with eventual debounced introduced by the user).
For some use cases, it would be preferable to trigger the `onChange` method only when the concerned text-based input looses the focus. (regardless of eventual debounce)

Of course, both scenarii are valid, and it's really a matter of personal preference.

### Describe the solution you'd like

It would be nice to upgrade all text-based renderers to have the two possibilities:

- trigger `onChange` when a character is typed in the input.
- trigger `onChange` when the input looses focus and its content has actually changed.

Users should be able to choose between the two behaviors by configuring a simple option in the JsonForms configuration.

### Describe alternatives you've considered

As a user, it should already be possible to achieve this by providing custom renderers and overriding the behavior in each used text-based renderer. But it would be so much cleaner if the change was centralized and inherited by supporting renderers.
Plus, as this looks like a recurring user need, we should probably consider this evolution intead of having diverging user renderers.

### Framework

React, Angular, Vue 3, Vue 2

### RendererSet

Material, Vanilla

### Additional context

See also discussion https://github.com/eclipse-emfcloud/emfcloud/discussions/152

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.