question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Slick inside fieldset, on Chrome causes crazy width calcs

See original GitHub issue

At this stage I haven’t had a chance to dig into the code and see what is happening, but here’s the repeatable issue.

If the carousel is inside a fieldset and you view it on Google Chrome, the slick-slide width gets blown right out (22000+), and it keeps getting bigger if you click on arrows etc

Stripped down the code to below, which demonstrates the issue. I f you remove the fieldset tag, all works as expected

http://jsfiddle.net/jimmyrose/fc5mmtmh/1/


<!DOCTYPE html>
<html>
<head>
    <title>Test</title>
    <link href="/Vendor/slick-1.3.13/slick/slick.css" rel="stylesheet"/>
    <script type="text/javascript" src="//code.jquery.com/jquery-1.11.0.min.js"></script>
    <script type="text/javascript" src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
</head>
    <body>
        <fieldset>
            <legend>Photos</legend>
            <div class="carousel">
                <div class="attachment"><img src="/Attachments/View/88?thumb=True" title="" alt="Jellyfish.jpg"/></div> 
                <div class="attachment"><img src="/Attachments/View/88?thumb=True" title="" alt="Jellyfish.jpg"/></div>
                <div class="attachment"><img src="/Attachments/View/88?thumb=True" title="" alt="Jellyfish.jpg"/></div>
                <div class="attachment"><img src="/Attachments/View/88?thumb=True" title="" alt="Jellyfish.jpg"/></div>
                <div class="attachment"><img src="/Attachments/View/88?thumb=True" title="" alt="Jellyfish.jpg"/></div>
                <div class="attachment"><img src="/Attachments/View/88?thumb=True" title="" alt="Jellyfish.jpg"/></div>
                <div class="attachment"><img src="/Attachments/View/88?thumb=True" title="" alt="Jellyfish.jpg"/></div>
                <div class="attachment"><img src="/Attachments/View/88?thumb=True" title="" alt="Jellyfish.jpg"/></div>   
            </div>


        </fieldset>
        <script type="text/javascript" src="/Vendor/slick-1.3.13/slick/slick.js"></script>

            <script type="text/javascript">
                $(document).ready(function () {
                    $('.carousel').slick({
                        slidesToShow: 4,
                        slidesToScroll: 2
                    });
                });
        </script>
    </body>
</html>

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Reactions:2
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
tjFogartycommented, Oct 30, 2014

I think I have a solution, it just involves overriding a Chrome default for min-width: http://jsfiddle.net/bpccL230/1/

0reactions
mshopericommented, May 25, 2017

Set the width on the carousel with jQuery like this (instead of CSS):

$(“#carousel”).width($(window).width());

To run the above code whenever the window is resized, you can do this:

$(window).resize(function(){ $(“#carousel”).width($(window).width()); });

Read more comments on GitHub >

github_iconTop Results From Across the Web

Google Chrome - Fieldset Overflow Bug
Chrome defines for fieldset the default user agent style: min-width: -webkit-min-content . So when your viewable area (aka "screen") is smaller ...
Read more >
Untitled
Fieldset width in jsp, Max pending connections wcf? Owa public folders exchange 2010, Poly bottle chemistry, Raphael js svg icons, Nsb 40-25?
Read more >
Untitled
Ciudad de tobati en guarani, Tollytots 5-in-1 graco doll stroller, Reproducir mkv en tv, ... Cafe astrology transit calculator, Nba best teams in...
Read more >
Slick not compatible with latest chrome 80 update - Drupal
I am definitely seeing similar results as @tramsaal, slide widths initializing correctly and then blowing way out of proportion. There appears ...
Read more >
Styling Radio Buttons with CSS (59 Custom Examples)
But what makes these buttons so special is the animation. ... The CSS buttons only work in Chrome, but the original ones work...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found