Skip to content

Commit f971207

Browse files
author
Alexis Córdova
authored
fix(checkbox): Prevent Checkboxes from Collapsing with Long Wrapping Text (#4980)
1 parent f502650 commit f971207

File tree

4 files changed

+35
-0
lines changed

4 files changed

+35
-0
lines changed

RELEASENOTES.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
<!-- Release notes authoring guidelines: http://keepachangelog.com/ -->
22
<!-- !!! THIS FILE IS AUTO-GENERATED !!! DO NOT EDIT THIS FILE MANUALLY !!! -->
33

4+
## Release 2.17.3 - January 25, 2022
5+
6+
## Components
7+
### [Checkbox](https://www.lightningdesignsystem.com/components/checkbox)
8+
#### Fixed
9+
- Checkbox inputs will no longer collapse horizontally when a label with a large amount of text is used.
10+
411
## Release 2.17.2 - January 20, 2022
512

613
## Components

ui/components/checkbox/RELEASENOTES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
<!-- ## [Unreleased] -->
66

7+
## 2.17.3
8+
9+
### Fixed
10+
- Checkbox inputs will no longer collapse horizontally when a label with a large amount of text is used.
11+
712
## 2.17.0
813

914
### Added

ui/components/checkbox/base/_index.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
@include square($square-icon-medium-content);
3333
display: inline-block;
3434
position: relative;
35+
flex-shrink: 0;
3536
vertical-align: middle;
3637
// @todo consider shared hooks for inputs
3738
border-radius: var(--slds-c-checkbox-radius-border, var(--sds-c-checkbox-radius-border, $border-radius-small));

ui/components/checkbox/base/example.jsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,28 @@ export let examples = [
275275
</Fieldset>
276276
)
277277
},
278+
{
279+
id: 'long-wrapping-text-required-group',
280+
label: 'Required Checkboxes with Abnormally-long Wrapping Text',
281+
demoStyles: `width: 210px`,
282+
storybookStyles: true,
283+
element: (
284+
<Fieldset>
285+
<Legend>
286+
<abbr className="slds-required" title="required">
287+
*{' '}
288+
</abbr>
289+
Checkbox Group Label
290+
</Legend>
291+
<FormElementControl>
292+
<Checkbox label="When you wake up in the morning, it's a quarter to one, And you want to have a little fun. You brush your teeth, ch ch ch ch, ch ch ch ch. You brush your teeth, ch ch ch ch, ch ch ch ch" />
293+
<Checkbox label="When you wake up in the morning, it's a quarter to two, And you want to find, something to do. You brush your teeth, ch ch ch ch, ch ch ch ch. You brush your teeth, ch ch ch ch, ch ch ch ch" />
294+
<Checkbox label="And when you wake up in the morning, it's a quarter to three, And your mind starts hummin', twiddle dee dee. You brush your teeth, ch ch ch ch, ch ch ch ch. You brush your teeth, ch ch ch ch, ch ch ch ch" />
295+
<Checkbox label="When you wake up in the morning, it's a quarter to four, And you think you hear a knock on the door. You brush your teeth, ch ch ch ch, ch ch ch ch. You brush your teeth, ch ch ch ch, ch ch ch ch" />
296+
</FormElementControl>
297+
</Fieldset>
298+
)
299+
},
278300
{
279301
id: 'group',
280302
label: 'Group',

0 commit comments

Comments
 (0)