Giter Site home page Giter Site logo

Comments (7)

Finesse avatar Finesse commented on May 21, 2024 1

@simonwep I mean a button which makes the following when clicked:

  1. onChange handler is called with null or something similar as the first argument.
  2. The open button shows that a color is not chosen. For example, this way: image

from pickr.

JamoCA avatar JamoCA commented on May 21, 2024 1

Is there any way to use pickr.setColor() to set unchosen color? I'm additionally allowing an input field to be used and an empty field (0 length string; not NULL) is an option. I'm using setColor() to update the pickr button upon changing the value, but do not know how to programmatically set it to this new "no selection" option. Thanks.

from pickr.

simonwep avatar simonwep commented on May 21, 2024 1

@JamoCA I've added it in 9a6548d :)

from pickr.

simonwep avatar simonwep commented on May 21, 2024

To understand you correctly, you mean something like a reset-button which will set the current color back to default?

from pickr.

simonwep avatar simonwep commented on May 21, 2024

I've added the feature in 906e10c :)
There is also a new version available, 0.1.0, slowly it's going into beta phase, so it hasn't fully backwards-compatibility. (It's only the method cancel() which doesn't exists anymore, and some changes in hide() and show()).

from pickr.

simonwep avatar simonwep commented on May 21, 2024

@JamoCA This is currently not possible, but would be a great feature! I'll add it, probably, as you say, using pickr.setColor(null) would be the best option to remove it.

from pickr.

JamoCA avatar JamoCA commented on May 21, 2024

The update works perfectly! I usually automatically assign default colors if not specified by the user. I was interested in using this library, but it was a showstopper if users couldn't clear/reset selected colors. Thanks!

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.