bootstrap-switch icon indicating copy to clipboard operation
bootstrap-switch copied to clipboard

Width calculation issue

Open jainabhishek14 opened this issue 7 years ago • 10 comments

There is an issue while calculating width of the container on chrome 53.0.2785.143 (64 bit) browser. (not sure about other versions). But it is working fine on firefox except random times. Screenshot attached. Firefox: screenshot from 2017-03-06 19-02-15

Chrome: screenshot from 2017-03-06 19-04-51

jainabhishek14 avatar Mar 06 '17 13:03 jainabhishek14

It's the same for me when use Bootstrap Modal. In Google Chrome and Google Chrome Mobile 1 screenshot_2017-03-20-23-53-33

makaronnik avatar Mar 20 '17 21:03 makaronnik

I'm getting the opposite problem, the switch width seem s to extend the entire width of the container that it is in. Again, only in chrome, works fine in firefox and safari.

screenshot

cyrillegin avatar Jul 10 '17 00:07 cyrillegin

this problem is in version 3.3.4 and in master. version 3.3.3 is correct.

ickbinhier avatar Jul 18 '17 11:07 ickbinhier

3.3.4 has an issue for our project too. The change to display: table-cell and vertical-align: middle on the handles and label meant that even though the width was being calculated correctly, it would not apply in the browser because table cells can shrink.

Our workaround was to add this to our CSS:

.bootstrap-switch .bootstrap-switch-handle-on,
.bootstrap-switch .bootstrap-switch-handle-off,
.bootstrap-switch .bootstrap-switch-label {
    display: inline-block;
    vertical-align: baseline;
}

jameshoward avatar Aug 02 '17 09:08 jameshoward

@jameshoward Confirmed the workaround works with bootstrap 3.3.7

driade avatar Aug 28 '17 15:08 driade

Not working here. The whole label is collapsing: screenshot - Please click the second image.

Quix0r avatar Nov 20 '17 16:11 Quix0r

We had the same problem after an update from 3.3.3 to 3.3.4 - element widths corrupted (Chrome 62.0.3202.94). I can confirm that the workaround suggested by @jameshoward fixes our problem. Clearly a proper fix is needed.

losttheplot avatar Nov 20 '17 22:11 losttheplot

I had a .bootstrap-switch-label with text and image. It only calculates the width correctly when the image has a fixed width, max-width for example is not working, causing the switch to be wrong calculated.

Quix0r avatar Nov 21 '17 09:11 Quix0r

Oddly, I am seeing this as an intermittent problem. Sometimes it renders properly - other times its completely broken.

superbazza avatar Feb 08 '19 09:02 superbazza

Further to previous comment: With zero code changes between them, I see it broken in live - and rendering fine in staging env - and rendering fine locally. It is therefore impossible to figure out how to fix it if I cannot reproduce locally :(

Whiskey Tango Foxtrot ?

superbazza avatar Feb 08 '19 11:02 superbazza