mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-25 01:16:18 -05:00
ui: an input goes under its label, not beside it
InputForm returned a fragment, so its label and its field arrived as two children of whatever contained them. In a grid that is two cells: on /videos/settings the "Video File Format" and "Extra yt-dlp Arguments" inputs sat in the column to the right of their own labels. The label is now block with the same 4px gap the migrated fields use (FieldLabel in Download.js), so an InputForm and a DestinationForm side by side start their inputs at the same height -- the Channel Name and Directory fields on the Channel edit page were off by the difference. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
8c614989de
commit
cd8a777caa
2 changed files with 48 additions and 3 deletions
|
|
@ -356,8 +356,15 @@ export function InputForm({
|
|||
</Message>;
|
||||
}
|
||||
|
||||
return <>
|
||||
<label htmlFor={`${name}_input`}>
|
||||
/*
|
||||
* One element, not a fragment: every caller that puts an InputForm in a grid or flex
|
||||
* container was getting the label and the input laid out as two separate items -- the
|
||||
* input beside its own label rather than under it. The label is block with the same
|
||||
* 4px gap the migrated fields (Download.js FieldLabel) use, so an InputForm and a
|
||||
* DestinationForm side by side line their inputs up at the same height.
|
||||
*/
|
||||
return <div>
|
||||
<label htmlFor={`${name}_input`} style={{display: 'block', marginBottom: 4}}>
|
||||
<b>{label} {required && <RequiredAsterisk/>}</b>
|
||||
{helpContent &&
|
||||
<InfoPopup
|
||||
|
|
@ -375,7 +382,7 @@ export function InputForm({
|
|||
/>
|
||||
</div>
|
||||
{messageElm}
|
||||
</>
|
||||
</div>
|
||||
}
|
||||
|
||||
export function NumberInputForm({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue