Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checkbox, Radio: fix slotted text not wrapping #3649

Conversation

RasmusKjeldgaard
Copy link
Collaborator

Which issue does this PR close?

This PR closes #3648

What is the new behavior?

Adding text in the default slot of checkbox or radio will now wrap, similar to how it does for text set with the text-property.
The white-space style declaration is moved to the label-text-wrapper part as it is used for both types of text.

Does this PR introduce a breaking change?

  • Yes
  • No

Checklist:

The following tasks should be carried out in sequence in order to follow the process of contributing correctly.

Reminders

  • Make sure you have implemented tests following the guidelines in: "The good: Test".
  • Make sure you have updated the cookbook with examples and showcases (for bug fixes, enhancements & new components).

Review

  • Determine if your changes are a fix, feature or breaking-change, and add the matching label to your PR. If it is tooling, dependency updates or similar, add ignore-for-release.
  • Do a self-review.
  • Request that the changes are code-reviewed
  • Request that the changes are UX reviewed (only necessary if your PR introduces visual changes)

When the pull request has been approved it will be merged to develop by Team Kirby.

@RasmusKjeldgaard RasmusKjeldgaard added the fix Add this PR to the changelog as a bugfix label Sep 30, 2024
Copy link
Collaborator

@jkaltoft jkaltoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reason for not letting the label text flow and wrap naturally - equivalent to white-space: normal (initial value)?

@RasmusKjeldgaard
Copy link
Collaborator Author

What is the reason for not letting the label text flow and wrap naturally - equivalent to white-space: normal (initial value)?

Excellent question! I forgot to mention it in the PR description, sorry!
It is to preserve the functionality for creating line-breaks when text is supplied via the text property. So definitely something we should look into removing down the line, now that content can be slotted instead of supplied as a property.

image

Copy link
Collaborator

@jkaltoft jkaltoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

giphub

@RasmusKjeldgaard RasmusKjeldgaard merged commit e735f3e into develop Oct 1, 2024
12 checks passed
@RasmusKjeldgaard RasmusKjeldgaard deleted the bug/3648-slotted-text-in-checkbox-radio-does-not-wrap branch October 1, 2024 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Add this PR to the changelog as a bugfix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Slotted text inside checkbox and radio does not wrap
2 participants