Altinn / Altinn/app-frontend-react

Improve visual design for "Grid" when validation are shown

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

Description

### Description

The layout of "Grid" behaves in unwanted ways:
1. The text in the column should be TOP-adjusted to maintain readability.
2. It should be possible to use the entire width of a column even if innerGrid is used to adjust its length.

![image](https://github.com/Altinn/app-frontend-react/assets/42466346/5ea3736f-00e0-4b6b-9f15-f31a78ebffa6)

### Additional Information

Here is the code I used for the page layout for the screenshot:

` {
"id": "Group-grid-inni-gruppe-TEST",
"type": "Group",
"textResourceBindings": {
"title": "ra0481.S10_Dinntekt.Input-godsfrakt-egne-eller-innleide.header"
},
"children": [
"Grid-fordel-driftsinntekt-prosent-Reisecerteparti"
]
},
{
"id": "Grid-fordel-driftsinntekt-prosent-Reisecerteparti",
"type": "Grid",
"rows": [
{
"cells": [
{
"text": "ra0481.S10_Dinntekt.mellom.norsk.og.utenlandsk",
"width": "50%"
},
{
"component": "Input-godsfrakt-egne-eller-innleide-CZxqAP"
}
]
},
{
"cells": [
{
"text": "ra0481.S10_Dinntekt.mellom.utenlandske",
"width": "50%"
},
{
"component": "Input-godsfrakt-egne-eller-innleide-dWqrH4"
}
]
},
{
"readOnly": true,
"cells": [
{
"text": "ra0481.S10_Dinntekt.sum.tabell.totalt",
"width": "50%"
},
{
"component": "Input-godsfrakt-egne-eller-innleide-W5uROZ-Tot"
}
]
}
]
},
{
"id": "Input-godsfrakt-egne-eller-innleide-CZxqAP",
"type": "Input",
"dataModelBindings": {
"simpleBinding": "SkjemaData.f502_Drift.f502_InntEgneUtenriksPNU"
},
"required": true,
"autocomplete": "off",
"formatting": {
"unit": "percent",
"number": {
"allowNegative": false,
"decimalScale": 0
}
},
"grid": {
"innerGrid": {
"md": 5
}
},
"textResourceBindings": {
"title": "ra0481.S10_Dinntekt.Input-godsfrakt-egne-eller-innleide-CZxqAP.title"
}
},
{
"id": "Input-godsfrakt-egne-eller-innleide-dWqrH4",
"type": "Input",
"dataModelBindings": {
"simpleBinding": "SkjemaData.f502_Drift.f502_InntEgneUtenriksPUU"
},
"required": true,
"autocomplete": "off",
"formatting": {
"unit": "percent",
"number": {
"allowNegative": false,
"decimalScale": 0
}
},
"grid": {
"innerGrid": {
"md": 5
}
},
"textResourceBindings": {
"title": "ra0481.S10_Dinntekt.Input-godsfrakt-egne-eller-innleide-dWqrH4.title"
}
},
{
"id": "Input-godsfrakt-egne-eller-innleide-W5uROZ-Tot",
"type": "Input",
"dataModelBindings": {
"simpleBinding": "SkjemaData.f502_Drift.f502_InntEgneUtenriksTot"
},
"required": false,
"autocomplete": "off",
"formatting": {
"unit": "percent",
"number": {
"allowNegative": false,
"decimalScale": 0
}
},
"readOnly": true,
"showValidations": [],
"grid": {
"innerGrid": {
"md": 5
}
},
"textResourceBindings": {
"title": "ra0481.S10_Dinntekt.Input-godsfrakt-egne-eller-innleide-W5uROZ.title"
}
},`

Contributor guide

Open the contributing guide

Research direction

Start by locating the Grid component and its validation rendering, then reproduce the layout using the configuration and screenshot in the issue, including inputs with innerGrid md: 5. Done means Grid text is top-aligned and a column can use its full width despite innerGrid; verify the resulting layout with validation messages visible.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
design, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.