paper-radio-button icon indicating copy to clipboard operation
paper-radio-button copied to clipboard

paper-radio-button label width is not constrained to the width of the container

Open tmpduarte opened this issue 8 years ago • 1 comments

Description

The label width of the paper-radio-button does not respect the width of the parent (paper-radio-button)

Expected outcome

It is expected that the label does not fall off the width provided to the paper-radio-button

Actual outcome

captura de ecra 2017-02-15 as 09 47 51

Please observe that the label (surrounded by a 1px solid black outline) is rendered outside of the paper-radio-button (cyan background color).

Steps to reproduce

  1. Put a containing div inside the page with some background-color
  2. Put the paper-radio-button element inside the container. Please give it a proper text that is bigger than 1 word.
  3. Open the page in a web browser.
  4. Reduce the size of the browser and observe that the paper-radio-button label is rendered outside of the containing div.

Browsers Affected

All browsers are affected. It is a browser independent issue.

tmpduarte avatar Feb 15 '17 08:02 tmpduarte

I think the following solution for the issue might work: which is setting the width of the label to the following: #radioLabel { width: calc(100% - var(--calculated-paper-radio-button-size, 16px) - var(--paper-radio-button-label-spacing, 10px)); }

According to the Pull Request guidelines only pull requests with tests will be considered. In a case like this, in which a visual 'glitch' is present is it necessary/possible to unit test the issue?

tmpduarte avatar Feb 15 '17 09:02 tmpduarte