Altinn / Altinn/app-frontend-react

Hint text in Dropdown and other input fields

Open
#2,155 2 comments 0 reactions 0 assignees View on GitHub
kind/feature-request org/brg
Dominant language
TypeScript
Stars
21
Forks
33
Avg merge
6d 23h
Merged PRs (30d)
3

Description

### Description

When I create a dropdown there is often a need for having a hint text which shows the user what kind of options that appear if they press the dropdown list. A hint text could be "Velg politidistrikt.." and when the user presses it sees the kind of options, and if it is a required field it is not possible to leave it empty. Today you have to put this as a option in the list, but then you have to create custom validation to check if this option is selected.

### Additional Information

![Skjermbilde 2024-06-12 kl 10 38 34](https://github.com/Altinn/app-frontend-react/assets/56260049/ac44d213-1cf5-489b-82ad-8e326b0d54fa)
I want it to be similar as the date field where there is a grey text, which only works as a hint to the user, and this should be a textResourceBinding e.g "hint" for Dropdown and also be great for all kinds of input fields.
![Skjermbilde 2024-06-12 kl 10 30 32](https://github.com/Altinn/app-frontend-react/assets/56260049/f45fefbd-2ee8-465d-a84e-8a51edfbef1e)

Contributor guide

Open the contributing guide

Research direction

Start by locating the Dropdown and date-field implementations in the React frontend and compare how their hint text is rendered and bound to text resources. Then inspect the other input field components to determine the shared scope. Done means a hint such as “Velg politidistrikt..” is displayed without becoming an option, required dropdowns cannot remain empty, and the hint is configurable through a textResourceBinding.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.