Giter Site home page Giter Site logo

Default Color issue about pickr HOT 18 CLOSED

simonwep avatar simonwep commented on May 22, 2024 1
Default Color issue

from pickr.

Comments (18)

LeFrach avatar LeFrach commented on May 22, 2024 1

In my case the problem is due to bootstrap's tab, to solve my problem I put the pickrTab active.
Or I defer instanciation after the click on the tab.

image

By the way, Thank you very much for this great pickr librairy, I really like it :)

from pickr.

nickbrit avatar nickbrit commented on May 22, 2024 1

I think it's because the picker is not visible and this.wrapper.offsetHeight is 0.
https://github.com/Simonwep/pickr/blob/0c5b5c180cfb79c3760883859445459c2a4d18b6/src/js/pickr.js#L236
It's why background will be linear-gradient(to top, rgba(0, 0, 0, 1), transparent), linear-gradient(to left, hsla(NaN, 100%, 50%, 1), rgba(255, 255, 255, 1)).

from pickr.

simonwep avatar simonwep commented on May 22, 2024 1

Thanks to @nickbrit, fixed! JSFiddle fork: https://jsfiddle.net/ew9zq0sg/ see f354a34 😃

from pickr.

simonwep avatar simonwep commented on May 22, 2024

Could you please provide information how to reproduce it? Maybe a JSFiddle.

from pickr.

SkaveRat avatar SkaveRat commented on May 22, 2024

I can confirm this issue, but can't seem to replicate it in JSFiddle

What happens, however, seems to be that .pcr-palette and .pcr-picker don't get their styles set untill a user clicks on the palette. Before that the palette shows a checker pattern.

This also only started happening when updating to 0.3.4 (before I had 0.3.2)

from pickr.

simonwep avatar simonwep commented on May 22, 2024

Which browser (/ version) do you guys use? Seems like a strange bug

from pickr.

sudheerm589 avatar sudheerm589 commented on May 22, 2024

from pickr.

simonwep avatar simonwep commented on May 22, 2024

Version? I cannot reproduce it with these little informations... At least the environment, style / script including or packaging tool would be helpful!

from pickr.

JakeOcean avatar JakeOcean commented on May 22, 2024

I noticed this issue with firefox

from pickr.

SkaveRat avatar SkaveRat commented on May 22, 2024

Tested with Chrome 69+ and firefox 61+

diff-ing the two versions, I'd guess it has something to do with the introduction of initializing via requestAnimationFrame .
If I had to guess, there is something (maybe in the dependencies people use?) that messes with requestanimationframe.

from pickr.

JakeOcean avatar JakeOcean commented on May 22, 2024

@SkaveRat

In my case I noticed that I had the default within the 'components' array, and once I moved it above it worked as expected. I cant remember where I copied the original demo code from where the defautl was in the wrong place

from pickr.

LeFrach avatar LeFrach commented on May 22, 2024

Hello,
Same problem here (Chromium 66.x)

image

from pickr.

simonwep avatar simonwep commented on May 22, 2024

Okay, thank you all! I'll try to reproduce / fix it! :)

from pickr.

simonwep avatar simonwep commented on May 22, 2024

I think this is also related to #4 and #31. This comment seems to solve this bug (maybe). I'm not sure in which environment this bug appears... Be sure to load pickr's css before all the javascript. Otherwise things like @LeFrach's screenshot happens. Moreover, don't use the defer attribute.

For example, try to add all of your css in the head element and place your JS at the very bottom of body.

from pickr.

nickbrit avatar nickbrit commented on May 22, 2024

I can replicate this issue on Tab 2 https://jsfiddle.net/zbpn59cd/4/.
http://g.recordit.co/L56GZQACV8.gif

Chrome 71/ MacOS

from pickr.

SkaveRat avatar SkaveRat commented on May 22, 2024

can confirm. not being visible is the cause. In my case it's also not visible on page load.

Just checked, and the pallette works fine when it's visible on page load.

from pickr.

sudheerm589 avatar sudheerm589 commented on May 22, 2024

from pickr.

LeFrach avatar LeFrach commented on May 22, 2024

Yes problem solved for me, thank you !

from pickr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.