Skip to content

Commit

Permalink
fix(FieldBlock): remove max-width for label when width stretch (#4406)
Browse files Browse the repository at this point in the history

Co-authored-by: Tobias Høegh <[email protected]>
  • Loading branch information
langz and tujoworker authored Dec 13, 2024
1 parent 85ad8a4 commit 20c02d4
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const Widths = () => {
<TestElement>Contents</TestElement>
</FieldBlock>
<FieldBlock
label="Stretch (affects outer block element)"
label="Stretch (affects outer block element). This label is long to validate that label also stretches full width."
width="stretch"
>
<TestElement>Contents</TestElement>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const stringProperties: PropertiesTableProps = {
status: 'optional',
},
width: {
doc: '`false` for no width (use browser default), small, medium or large for predefined standard widths, stretch for fill available width.',
doc: '`false` for no width (use browser default), small, medium or large for predefined standard widths, stretch to fill available width.',
type: ['string', 'false'],
status: 'optional',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,31 @@ import { Flex } from '../../../../../components'
export default {
title: 'Eufemia/Extensions/Forms/String',
}
export const StringAndLabelStretch = () => {
return (
<Form.Card>
<Form.SubHeading>Subheading</Form.SubHeading>
<Field.String
help={{ title: 'Help title', content: 'Help content' }}
path="/moreInfo"
label="Her kan du gi oss andre opplysninger som du tror kan være relevante for søknaden. Ønsker du for eksempel fastrente eller rammelån, kan du skrive det her."
multiline
autoresize
maxLength={250}
characterCounter={{
max: 250,
variant: 'down',
}}
/>
<Field.Number
label="Her kan du gi oss andre opplysninger som du tror kan være relevante for søknaden. Ønsker du for eksempel fastrente eller rammelån, kan du skrive det her."
placeholder="Enter a number..."
size="large"
width="stretch"
/>
</Form.Card>
)
}

export const String = () => {
return (
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ fieldset.dnb-forms-field-block {
&--width {
&-stretch {
flex-grow: 1;
label.dnb-form-label {
max-width: none;
}
}
@include allAbove(x-small) {
&-custom {
Expand Down

0 comments on commit 20c02d4

Please sign in to comment.