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.

Slide's Inline Style is Removed When Targeted by Responsive Breakpoints

See original GitHub issue

When using the responsive setting, inline style is removed from the slick wrapper’s child (i.e. our content that is nested inside slick-slide) when they are targeted by a responsive breakpoint. This was largely unexpected because inline style is preserved if not targeted by responsive breakpoints. This affects both mobileFirst: true or false.

====================================================================

jsFiddle

http://jsfiddle.net/e1n5he7e/6/

====================================================================

Steps to reproduce the problem

  1. Add responsive settings
  2. Load page in layout that would not be affected by breakpoints (i.e. if not mobileFirst:true window size is greater than breakpoint) . Inline style should be preserved (in the jsFiddle inline style is simply color:red)
  3. Load and/or Resize page so that responsive breakpoint becomes active. Inline style will be replaced.

====================================================================

What is the expected behaviour?

  • inline style should be appended to by slick instead of replaced by slick
  • behavior would be consistent one-way or the other (either always replace inline-style or never replace-inline style - regardless of responsive settings)

====================================================================

What is observed behaviour?

  • inline style is replaced ONLY when affected by breakpoints

====================================================================

More Details

  • Chrome 66 OSX
  • jQuery 1.12.4
  • Slick 1.9.0
  • Did this work before? (I am unsure)

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:9

github_iconTop GitHub Comments

1reaction
mackr2015commented, Nov 20, 2019

@lillorme actually this works!! Bypassing the main element in slider… hahaha easy fix but works!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Slick Slide Removes Inline Styling on Responsive Breakpoints
You have to remove originalSlides.removeAttr('style'); on line 826. It's a workaround but it works. Share.
Read more >
slick - the last carousel you'll ever need - Ken Wheeler
slick is a responsive carousel jQuery plugin that supports multiple breakpoints, CSS3 transitions, touch events/swiping & much more!
Read more >
CSS · Bootstrap
Grid classes apply to devices with screen widths greater than or equal to the breakpoint sizes, and override grid classes targeted at smaller...
Read more >
TailwindCSS: Adds complexity, does nothing.
For example: Lifewire: Avoiding Inline Styles for CSS Design. ... and your team for years to come, and it's going to be hard...
Read more >
How To Use CSS Breakpoints For Responsive Design
In other terms, CSS media query breakpoints are the pixel values that a developer can specify in the CSS code. An adjustment is...
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