eclipsesource / eclipsesource/jsonforms

Support Start-/EndAdornments for Input fields

Offen
#2,018 1 Kommentar 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
feature material react
Vorherrschende Sprache
TypeScript
Sterne
2.7k
Forks
424
Ø Merge
17 T. 8 Std.
Gemergte PRs (30 T.)
1

Beschreibung

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

When inputting number/integers it is often required to indicate what unit needs to be kept in mind.
It is currently not possible to use inputAdornments when using jsonForms

### Describe the solution you'd like

I would like to add support to all inputFields to have a start or end adornment.
At least for the material renderers in react, this shouldn't be to hard because of the out-of-the-box support or adornments in the MUI React library (https://mui.com/material-ui/api/input-adornment/#main-content)

### Describe alternatives you've considered

I tried to adapt the existing controls, to add an `startAdornment` and/or `endAdornment` prop to the MUI `Input`-component.

This is however currently not possible because:

- `MuiInputInteger` and `MuiInputNumber` don't forward props to the `Input` component (https://github.com/eclipsesource/jsonforms/blob/master/packages/material/src/mui-controls/MuiInputInteger.tsx)
- the generic `MaterialInputControl` (adding all of the surrounding components, like label, description, helperTexts, ...) is not exported from the library, so we current can't redefine an additional `MaterialIntegerControl` with support for the start- endAdornments

### Framework

React

### RendererSet

Material

### Additional context

_No response_

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Lies zunächst packages/material/src/mui-controls/MuiInputInteger.tsx und die entsprechende MuiInputNumber-Implementierung und verfolge anschließend, wie MaterialInputControl Labels, Beschreibungen und Hilfetext zusammensetzt. Prüfe die vorhandenen Material-Renderer-Tests oder Beispiele, bevor du Änderungen vornimmst. Erledigt ist die Aufgabe, wenn Material-React-Eingabefelder konfigurierbare Start- und End-Adornments unterstützen, ohne ihr bisheriges Steuerungsverhalten zu verlieren.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
react, typescript
Bereich
frontend
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.