FlowFuse / FlowFuse/node-red-dashboard

Form widget - layout shift when required input field shows the message "<name> is required"

Open
#1,027 0 comments 0 reactions 0 assignees View on GitHub
needs-triage type:bug
Dominant language
HTML
Stars
355
Forks
82
Avg merge
4d 23h
Merged PRs (30d)
24

Description

### Current Behavior

Carefully designed cards with same height

![image](https://github.com/FlowFuse/node-red-dashboard/assets/35291460/27d95450-6c0e-4882-8a80-1f50832d65cf)

With message fired the layout of the card gets affected

![image](https://github.com/FlowFuse/node-red-dashboard/assets/35291460/4a02420f-4f2b-4008-a8cc-ce430a5bdc74)

### Expected Behavior

The card layout should not be affected.

### Steps To Reproduce

No steps but proposal:

Render the message with position absolute
![image](https://github.com/FlowFuse/node-red-dashboard/assets/35291460/c3d27b2b-5ff1-4f13-a671-42f48a068d02)

The CSS

```
.nrdb-ui-form-rows .nrdb-ui-text-field{
position: relative;
}
.nrdb-ui-form-rows .v-input__details{
position: absolute;
right: 1rem;
bottom: -0.5rem;
padding: unset;
}
.nrdb-ui-form-rows .v-messages__message{
background-color: rgb(var(--v-theme-group-background)) ;
display:inline;
padding-inline: .25rem;
}
```
Tested with all form elements where "required" option is available
(with Chrome, FF & Edge)

![image](https://github.com/FlowFuse/node-red-dashboard/assets/35291460/bd6d2ef5-1c27-495e-86a2-6e0bf6649994)

Little bit of over-crowded when narrow card has form with 2-column layout. But still ,no layout shift.

![image](https://github.com/FlowFuse/node-red-dashboard/assets/35291460/d3b8d2b6-deee-40a3-baa9-e62cf20dd812)

### Environment

- Dashboard version:
- Node-RED version:
- Node.js version:
- npm version:
- Platform/OS:
- Browser:

### Have you provided an initial effort estimate for this issue?

I can not provide an initial effort estimate

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.