siemens / ix

Siemens Industrial Experience is a design system for designers and developers, to consistently create the perfect digital experience for industrial software products.
https://ix.siemens.io/
MIT License
197 stars 65 forks source link

Checkboxes with multiline label overlap each other #1226

Open Stefei opened 5 months ago

Stefei commented 5 months ago

Prerequisites

What happened?

Stacking multiple checkboxes with multiline labels results in them overlapping each other:

grafik

What type of frontend framework are you seeing the problem on?

Angular, JavaScript

Which version of iX do you use?

v2.1.0

Code to produce this issue.

<div style="display: flex; flex-direction: column">
    <input type="checkbox" id="checkbox_01" />
      <label for="checkbox_01">Long Label 1: Lorem ipsum dolor sit amet, consetetur sadipscing elitr</label>
      <input type="checkbox" id="checkbox_02" />
      <label for="checkbox_02">Long Label 2: Lorem ipsum dolor sit amet, consetetur sadipscing elitr</label>
      <input type="checkbox" id="checkbox_03" />
      <label for="checkbox_03">Long Label 3: Lorem ipsum dolor sit amet, consetetur sadipscing elitr</label>
    </div>
ridvandmrc commented 5 months ago

Hi @Stefei , You can manipulate it your side like:

<div style="display: flex; flex-direction: column">
  <input type="checkbox" id="checkbox_01" />
    <label style="display:block; white-space: nowrap;overflow: hidden;text-overflow: ellipsis;max-width: 90%;" for="checkbox_01">Long Label 1: Lorem ipsum dolor sit amet, consetetur sadipscing elitr</label>
    <input type="checkbox" id="checkbox_02" />
    <label style="display:block; white-space: nowrap;overflow: hidden;text-overflow: ellipsis;max-width: 90%;"  for="checkbox_02">Long Label 2: Lorem ipsum dolor sit amet, consetetur sadipscing elitr</label>
    <input type="checkbox" id="checkbox_03" />
    <label style="display:block; white-space: nowrap;overflow: hidden;text-overflow: ellipsis;max-width: 90%;"  for="checkbox_03">Long Label 3: Lorem ipsum dolor sit amet, consetetur sadipscing elitr</label>
  </div>

result is like: image

Other way is arrange the height of label:

  <div style="display: flex; flex-direction: column;margin-top: 4rem;">
    <input type="checkbox" id="checkbox_01" />
      <label style="height:unset; max-height: unset;" for="checkbox_01">Long Label 1: Lorem ipsum dolor sit amet, consetetur sadipscing elitr</label>
      <input type="checkbox" id="checkbox_02" />
      <label style="height:unset; max-height: unset;" for="checkbox_02">Long Label 2: Lorem ipsum dolor sit amet, consetetur sadipscing elitr</label>
      <input type="checkbox" id="checkbox_03" />
      <label style="height:unset; max-height: unset;" for="checkbox_03">Long Label 3: Lorem ipsum dolor sit amet, consetetur sadipscing elitr</label>
    </div>

result is like:

image

it is up to you

nuke-ellington commented 4 months ago

Will be closed by #1273