Giter Site home page Giter Site logo

simonwep / pickr Goto Github PK

View Code? Open in Web Editor NEW
4.2K 31.0 285.0 6.43 MB

๐ŸŽจ Flat, simple, multi-themed, responsive and hackable Color-Picker library. No dependencies, no jQuery. Compatible with all CSS Frameworks e.g. Bootstrap, Materialize. Supports alpha channel, rgba, hsla, hsva and more!

Home Page: https://simonwep.github.io/pickr

License: MIT License

HTML 4.19% CSS 2.96% JavaScript 75.70% SCSS 17.16%
color-picker colorpicker color js-library widget ux-ui pickr material-design color-palette color-picker-library

pickr's Introduction

pickr's People

Contributors

acepace avatar adityatoshniwal avatar astronomersiva avatar defusion avatar deniskabalkin avatar dependabot[bot] avatar dmancecrg avatar dotkev avatar jackmcdade avatar jaschaio avatar jetroid avatar joallard avatar lacymorrow avatar lcpmarvel avatar mafar avatar mloureiro avatar n1kk avatar nateseymour avatar nisarhassan12 avatar pjfreeze avatar sauldoescode avatar simonwep avatar snc avatar tlaanemaa avatar willsoto avatar zfanli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pickr's Issues

Feature request: Ability to choose "no color"

It would be great if Pickr has an ability to select no color. "No color" is not the same as the fully transparent color. Selecting nothing can be used when there is a default color (e.g. page background) and a user can select either the default color or a custom color (to customise his background color).

"appendToBody: true" is broken

Do you want to request a feature or report a bug?

Bug.

What is the current behavior?

When setting "appendToBody: true", the popup does not open on click.

If the current behavior is a bug, please provide the steps to reproduce.

  • Add appendToBody: true, to gh-page/js/script.js
  • Open index.html
  • Click on the example pickr.

What is the expected behavior?

Popup should open.

Your environment:

Pickr-version: master (166ce8d6671be16cf81b7cefa7e29c7b73738490)
Browser-version: 68.0.3440.42 (Official Build) beta (64-bit)
Operating-system:  MacOs

Pickr is great! Thank you so much!!

Bug: hex text-field not working correctly when alpha channel is disabled

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

When changing the text-hex value the color becomes transparent when only 3 characters are shown, instead of when there are 4

If the current behavior is a bug, please provide the steps to reproduce.

Disable alpha channel via opacity: false
Start removing characters from the displayed hex value
Nothing happens when there are 4 characters (but it should as it doubles to RRGGBBAA)
When there are 3 characters it suddenly shows transparency

Example color used: #FFAAFF

What is the expected behavior?

4 characters should represent transparency, 3 should be a solid color

Your environment:

Pickr-version: 0.2.4
Browser-version:  Chrome  68.0.3440.106 (latest), same in FF
Operating-system:  Win7

Pickr button background invisible when ancestor background set

Do you want to request a feature or report a bug?

Bug.

What is the current behavior?

When the background of any ancestor of the pickr is set, the pickr button's background (checkerboard pattern indicating transparent colors) is not visible.

If the current behavior is a bug, please provide the steps to reproduce.

  • Go to https://simonwep.github.io/pickr/
  • chose a color with a low alpha value
    ==> checkerboard pattern visible
  • open developer tools
  • Add the following style to the body tag: background-color: white;
    ==> checkerboard pattern no more visible

What is the expected behavior?

The checkerboard pattern should be visible.

Your environment:

Pickr-version: 0.3.1
Browser-version: Chrome, Firefox, Edge, ... (version-independent)
Operating-system:  Mac, Windows, ...

Analysis

The problem is caused by the following style:

.pickr .pcr-button:before {
    ...
    z-index: -1;
}

I suggest using another element for the color selection and setting the checkerboard patter background to the .pcr-button itself.

Append to body

Thanks for this library, looks fantastic!

The problem is that we can't use it with elements that are with overflow hidden, there are any plans to add an option for append to the body?

Thanks in advance.

Accessibility

For use in Europe, the picker needs to be accessible.

A standard input[type=color] should maybe be polyfilled with the functionality provided, and WAI-ARIA used to tell screen readers what's going on. It also needs to be keyboard accessible.

:)

Close event callback

Is there a callback for closing?

I want to show a preview to the user on change, cancel removes the color and closing the picker revert back to default. This is what I currently have:

const el = document.querySelector('.picker-open');
const shape = document.querySelector('.picker-shape');

function updateShapeColor(color) {
  if (color) {
    shape.style.backgroundColor = color;
  } else {
    shape.style.backgroundColor = 'transparent';
  }
}

var lastPickedColor;

const pickr = new Pickr({
  el,
  default: 'rgb(215, 223, 33)',
  defaultRepresentation: 'RGBA',
  onChange: function(hsva) {
    if (hsva) {
      updateShapeColor(hsva.toRGBA().toString());
    }
  },
  onSave: function(hsva) {
    if (hsva) {
      lastPickedColor = hsva.toRGBA().toString();
      updateShapeColor(lastPickedColor);
    } else {
      updateShapeColor('');
    }
  },
  onClose: function() {
  	if (lastPickedColor) updateShapeColor(lastPickedColor);
  },
  components: {
    preview: true,
    opacity: true,
    hue: true,
    comparison: false,
    interaction: {
      hex: true,
      rgba: true,
      hsla: false,
      hsva: false,
      cmyk: false,
      input: true,
      clear: true,
      save: true
    }
  },
  strings: {
    save: 'Select',
    clear: 'Cancel'
  }
});

https://jsfiddle.net/2ga3eckL/

How to keep picker color always show ?

Hello Simonwep,
thanks for nice plugin!

I want to keep picker color always stay on the page without hide.
I tired use pickr.show() but when I click outside on body it will be hide picker color

thanks for your help!

Pickr Browser Compatibility

I'm having problems getting it running in IE 11. What is the browser compatibility for this widget? So far I've had to Polyfill Object.assign. Next problem I'm having isSymbol is undefined. Is there a way to polyfill this?

Pickr-version: 0.2.4
Browser-version: Internet Explorer 11
Operating-system: Windows 8.1

Inline color picker

Do you want to request a feature or report a bug?

feature

What is the current behavior?

The current build is built for having a fixed poisition at all times, not allowing for the color picker to be inline without custom styling built around it.

If the current behavior is a bug, please provide the steps to reproduce or create a JSFiddle.

What is the expected behavior?

Allow the developer configuring it to give a 'relative' position, which will bypass the fixed position and allow the user to have the color pickr act as a part of their form.

Your environment:

Pickr-version (see Pickr.version): Master (0.3.2 at time of writing)
Browser-version:  Firefox/Chrome
Operating-system:  Debian

Color picker closes on click over the palette when useAsButton: false and parent: 'body'

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

A click inside the palette will close the color picker when pickr is created with useAsButton: false and parent: 'body'

2018-10-16_15-28-00

If the current behavior is a bug, please provide the steps to reproduce.

const pickr = new Pickr({
    el: '.color-picker',

    default: '#42445A',
    useAsButton: false,
    parent: 'body',

    components: {

        preview: true,
        opacity: true,
        hue: true,

        interaction: {
            hex: true,
            rgba: true,
            hsva: true,
            input: true,
            clear: true,
            save: true
        }
    }

});

What is the expected behavior?

The palette is kept open on click. The pallete is closed when the Save button is clicked or the user clicks outside the color picker.

Your environment:

Pickr-version: master branch, latest commit: 954f46a
Browser-version:  Chrome 72.0.3581.0 (Official Build) canary (64-bit)
Operating-system:  Windows 10

Not initialized with the given color

Do you want to request a feature or report a bug?

bug

What is the current behavior?

Pickr does not initialized with the given color(#42445A),color picker zone is transparent.After I moved .pcr-picker picker's color will appeared,but not I defined.

avatar

avatar

After test,I'm sure this behavior conflicts with my code,but I have not found the problem in my code(allthough my code may has problem),maybe some code in Pickr is not very perfect.

If the current behavior is a bug, please provide the steps to reproduce.

What is the expected behavior?

Initialize with the color I defined.

Your environment:

Pickr-version:0.2.2
Browser-version:  Google Chrome68
Operating-system:  windows10

Custom template

Hi,

First of all this library is super cool ๐Ÿ‘

Im wondering is there anyway I can use custom template or modify existing template. I see there is a static method createFromTemplate to create, but however I'm not sure how to use.

When I checked the source for createFromTemplate it seems fixed.

Any thoughts?

Fontstack

Why include Montserrat from Google Fonts and then use Source Sans Pro?
Wouldnt it be better using a native fontstack like below?

$font-family:
  -apple-system,
  BlinkMacSystemFont,
  "Segoe UI",
  "Roboto",
  "Helvetica Neue", Arial, sans-serif, !default;

This is taken from Bootstrap but without the Emoji stuff.
https://getbootstrap.com/docs/4.1/content/reboot/#native-font-stack

Consider factory functions

Instead of using classes, consider using factory functions instead because then there would be no need for new and also by avoiding the use of this one would eliminate the need for _.bindClassUnderscoreFunctions(this); completely.

Overall should you consider using factory functions it may actually simplify the codebase and improve the code's portability as functions require no backwards transpilation to ES5 while at the same time improving composability by avoiding this and working only with plain objects instead of class instances.

No need to make everything a factory function but for something like the new Selectable(); helper it could be an improvement.

This is what the selectable.js helper would look like

import * as _ from './../lib/utils';

export default function Selectable(opt) {
    const selectable = {
        // Assign default values
        options: Object.assign({
            onchange: () => 0,
            className: ''
        }, opt),

        _ontap(evt) {
            const opt = selectable.options;

            opt.elements.forEach(e => e.classList.remove(opt.className));
            evt.target.classList.add(opt.className);

            opt.onchange();
        },

        destroy() {
            _.off(selectable.options.elements, 'click', selectable._ontap);
        }
    }

    _.on(selectable.options.elements, 'click', selectable._ontap);

    return selectable;
}

Note: changing this file in the codebase as it stands to the above code will not be breaking as calling new (function () {}) does not cause an error.

Perhaps read this article from Eric Elliott for more information on factory functions.

Click to save

For some simple cases, just clicking on the color (or to be more precise, mouseup) to save it is better.

Broken initialization when using `useAsButton`

Do you want to request a feature or report a bug?

bug

What is the current behavior?

The pickr does not initialize and throws an error.

If the current behavior is a bug, please provide the steps to reproduce.

Check the fiddle:
https://jsfiddle.net/hnwbqmLt/3/

What is the expected behavior?

Initialization and no errors... I guess it is related to #31 .

Your environment:

Pickr-version: 0.2.3 / master
Browser-version:  Chrome 68

Interactions for color is unknown

Do you want to request a feature or report a bug?

feature

What is the current behavior?

The interaction options for colors are static, it is not configureable which interaction option is choosen initial. Currently, per default, HEX is selected.
Additional, the selected interaction option for color is not directly accessible when saving.

What is the expected behavior?

The initial selected color interaction option should be defineable in the options - or automatically determined on the default value.
I am using an input field next to the pickr widget where the user is allowed to enter an RGBa String or a HEX code, it is confusing opening the widget with HEX selected when a RGBa String was given.

Furthermore, the onSave or onChange method should be aware which interaction option is currently active. So the return value can be either HEX or a RGBa String in my case.

Your environment:

Pickr-version: 0.1.9
Browser-version:  Chrome 68

Add destroy method

feature
I'm doing integration with the react, since there is no way to clean the event handlers after this meaningless work (

Stop propagation ? (Collapse)

When adding pickr inside a bootstrap collapse, it would be great to have a stop propagation option to prevent the collapse.
Of course, that option could be used in a lot more cases.

Deprecation Warning: Using unescaped '#' characters in a data URI.

I've been getting this deprecation warning the last couple of months, and hope we can fix it before functionality breaks in the latest Chrome. :)

[Deprecation] Using unescaped '#' characters in a data URI body is deprecated and will be removed in M71, around December 2018. Please use '%23' instead.

Environment:

Pickr-version (see Pickr.version): 0.3.2
Browser-version:  Chrome 71.0.3578.98
Operating-system: MacOS

parseToHSV() does not handle "1" alpha values

Do you want to request a feature or report a bug?

Bug.

What is the current behavior?

Color.parseToHSV("rgba(70,70,70,1)") returns null.

If the current behavior is a bug, please provide the steps to reproduce.

Color.parseToHSV("rgba(70,70,70,1)")

What is the expected behavior?

return the correct value.
This seems to be a regression introduced by 166ce8d

Your environment:

Pickr-version: latest master
Browser-version:  Chrome 68 beta
Operating-system:  MacOs

Layout bug on Chrome 69. Fix suggestion.

Just got layout bug. Reproduced on clean page (only Pickr included).
<div class="pcr-color-palette"> overlapped interaction bar.
Here is image:
pickr_bug

This is my fix suggestion (cannot create PR right now, sorry):
line 213 of .css file
.pcr-app .pcr-selection .pcr-color-chooser, .pcr-app .pcr-selection .pcr-color-opacity, .pcr-app .pcr-selection .pcr-color-palette { position: relative; user-select: none; display: flex; /* ADDED */ flex-direction: column; /* ADDED */ }

This fixed problem for me

Your environment:

Pickr-version: 0.2.5
Browser-version:  Chrome Version 69.0.3497.100 (Official Build) (64-bit)
Operating-system:  macOs High Sierra 10.13.6

Feature request: Swatches

Do you want to request a feature or report a bug?

feature

What is the current behavior?

pickr doesn't offer swatches

Would you consider adding a swatches option to pickr?
When enabled, present a bunch of small, colored boxes that the user can click to select that color.
This is how it should work: https://labs.abeautifulsite.net/jquery-minicolors/ (have a look at the "swatches" example in the "More..." paragraph).

Here's an idea of what it could look like. There would be room for about 12 swatches, that's plenty.

swatches

Pickr does not update the button color when setColor() is invoked

Do you want to request a feature or report a bug?

Bug.

What is the current behavior?

When calling pickr.setColor('#f00'), the color of the button is not updated correspondingly.

If the current behavior is a bug, please provide the steps to reproduce.

  • Open index.html
  • Open developer tools
  • pickr.setColor('#f00')
  • While the selected color inside the popup is changed, the button color is not updated.

What is the expected behavior?

The button color should be updated as well.

Your environment:

Pickr-version: master (166ce8d6671be16cf81b7cefa7e29c7b73738490)
Browser-version:  68.0.3440.42 (Official Build) beta (64-bit)
Operating-system:  MacOs

Using the Dialogtag leads to an inaccessible pickr widget

Do you want to request a feature or report a bug?

bug

What is the current behavior?

Using the "dialog"-Tag as modal with a custom button results in an inaccessible pickr.

As noted in #22 the flag appendToBody is always true in that case. Which does not work with dialogs.

If the current behavior is a bug, please provide the steps to reproduce.

See: https://jsfiddle.net/xjvsfy0n/

What is the expected behavior?

Pickr should be open in front of the dialog.

Your environment:

Pickr-version: 0.1.9
Browser-version:  Chrome 68
Operating-system:  

Reusing a widget or using it in multiple Pickr-instances

Hi,

i 've some input fields, and add the color-picker class to each of them.

Only the first input field, will work with the picker. Is that not possible to use your picker for multiple fields at same page or did i something wrong?

best regards,
Rene

Pickr sliders and output acting up on page load

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

Pickr initializes with #NANNANNAN even though the default is set to #FF1294 (which you can see in the preview of the last color saved).
The sliders are 100% not working and when clicking the transparency one, the resulting hex value is negative because the selected point is somewhere completely different (no idea where).

If the current behavior is a bug, please provide the steps to reproduce.

I used the following code, and just appended the .pickr div before initializing Pickr with that element (which seems to work just fine).

import Pickr from "pickr-widget/dist/pickr.min";

new Pickr({
  el: $(".pickr"),

  default: "#FF1294",

  components: {
    preview: true,
    opacity: true,
    hue: true,

    output: {
      hex: true,
      rgba: true,
      hsva: true,
      input: true
    }
  }
});

The weird thing is that the demo at https://simonwep.github.io/pickr/ seems to work just fine...
I am not sure of the exact root cause of this problem.
I don't want to show much of my code, but it works fine when I execute it from Devtools (shows expected behavior) but not from JS.
I am using Rollup with CommonJS, and am importing the dist file directly via import Pickr from 'pickr-widget/dist/pickr.min';

What is the expected behavior?

The output color is completely normal and the sliders work properly.

Your environment:

Pickr-version: 61a7ff46a11d9fc84da428fd826a2d03634b9456
Browser-version: Google Chrome Version 68.0.3440.17 (Official Build) beta (64-bit)
Operating-system:  macOS High Sierra 10.13.5

image

onChange fires if a default color is specified

Do you want to request a feature or report a bug?

bug

What is the current behavior?

onChange event fires immediately after creating a pickr object when specifying a default color using default in options

If the current behavior is a bug, please provide the steps to reproduce or create a [JSFiddle]

What is the expected behavior?

onChange should not fire when specifying a default color

Your environment:

Pickr-version (see Pickr.version): 0.3.2
Browser-version:  Firefox 64
Operating-system:  Linux

Replace/Disabling of the "button"

Do you want to request a feature or report a bug?

I want a new feature.

What is the current behavior?

Currently it is not possible to replace the "pcr-button" with an icon or something else. The only option is to overwrite the css class and hide the button by setting the opacity to 0. Hiding the button does not work as it breaks the positioning of the component.

What is the expected behavior?

It would be nice if I could replace the button with an icon or disable it in the config like all other buttons.

Your environment:

Pickr-version: 0.1.7  

Readme: Node setup instructions incorrect

Do you want to request a feature or report a bug?

bug, kinda...

What is the current behavior?

Importing instructions for using pickr in node use currently a destructuring pattern that is not necessary and lead to an error ('Pickr' is undefined):

import {Pickr} from '/node_modules/pickr-widget/dist/pickr.min';  // Javascript

What is the expected behavior?

The imported script already returns a function that represents the Pickr object, so destructuring is not needed.

import Pickr from '/node_modules/pickr-widget/dist/pickr.min';  // Javascript

Your environment:

Pickr-version: 0.2.2
Node-version: v8.11.3
Operating-system: Windows 10, 1803

HEX Code to HVSA vice versa is not accurate

Do you want to request a feature or report a bug?

bug

What is the current behavior?

Setting specific HEX codes for colors are changed in the preview for colors and for the onSave method.

If the current behavior is a bug, please provide the steps to reproduce.

Open https://jsfiddle.net/fs5re70h/

  • Initial default value is #D6A9DB

  • Opening the Pickr does display #D5A9DB

  • Clicking into the input field for manually setting a HEX code does change it to #D4A9DB

  • Use the button to set #D5A6DB

  • Opening the pickr widget will preview the HEX color code #D4A9DB.

What is the expected behavior?

The HEX color code should not change.

Your environment:

Pickr-version: 0.1.9, reproduced on 0.2.0 with the jsfiddle
Browser-version:  Chrome 68

Horizontal scroll bug

Do you want to request a feature or report a bug?

A bug.

What is the current behavior?

If the color input has positions about right side. Browser displays horizontal scroll after initial pickr. If I open and close pickr the horizontal scroll leaves. Looks like the problem is pcr-app don't has display: none; property

2018-11-17_15-13-21 2

If the current behavior is a bug, please provide the steps to reproduce.

Move input to the right side.

What is the expected behavior?

Without the horizontal scroll.

Your environment:

Pickr-version: 0.3.1
Browser-version:  Firefox 63.0.3
Operating-system:  Windows 7 64

Bug: Swatches not working

Do you want to request a feature or report a bug?

Bug:

What is the current behavior?

i added option swatches, but it is not working. it is not show in color-picker. hmmm
my code:

const pickr = new Pickr({
            el: '.color-picker',

            default: '#42445A',

            swatches: [
                '#F44336',
                '#E91E63',
                '#9C27B0',
                '#673AB7',
                '#3F51B5',
                '#2196F3',
                '#03A9F4',
                '#00BCD4',
                '#009688',
                '#4CAF50',
                '#8BC34A',
                '#CDDC39',
                '#FFEB3B',
                '#FFC107'
            ],

            components: {

                preview: true,
                opacity: true,
                hue: true,

                interaction: {
                    hex: true,
                    rgba: true,
                    hsva: true,
                    input: true,
                    clear: true,
                    save: true
                }
            }
        });

If the current behavior is a bug, please provide the steps to reproduce or create a JSFiddle.

What is the expected behavior?

Your environment:

Pickr-version (see Pickr.version):
Browser-version:  
Operating-system:  

Create some peakers

How to create some color peakers? If I create some instance they crash page or stay on left top corner. Only first peaker work good.

Pickr-version: 0.2.0
Browser-version: Chrome 68.0.3440.106
Operating-system: ubuntu

Color is not selected when clicking, only when dragging

Do you want to request a feature or report a bug?

Bug.

What is the current behavior?

Clicking into either the Hue-palette, the luminosity slider or the transparency slider does not set the value to where the user clicked. Only once the user drags (even 1px), the color is updated.

If the current behavior is a bug, please provide the steps to reproduce.

Go to https://jsfiddle.net/dL0e569h/1/ or to the official demo https://simonwep.github.io/pickr/ and open the color picker. Click anywhere into the hue palette without moving the mouse while clicking. Nothing happens. But keep the mouse button pressed, and drag a few pixels, and the color is picked.

What is the expected behavior?

The color should be updated just by clicking, without dragging. The pcr-picker circle should move to where the user clicked.

Your environment:

Pickr-version: Newest from npm (0.2.4)
Browser-version:  Google Chrome 69.0.34
Operating-system:  Windows 10 Home

I'd be happy if someone could help me out or offer a workaround. Thanks!

pcr-picker position, CSS size override and percents

Hello! You did a great job, your colorpicker is awesome.
But, here is some issues. It's about pcr-app size.

1 - CSS Override.
If I set only .pcr-app class height, pcr-picker position is correct.
( here is a demo http://jsfiddle.net/o3e5wqc7/7/ )

If I set .pcr-app height as child of any tag, pcr-picker position is correct.
( here is a demo http://jsfiddle.net/o3e5wqc7/8/ )

If I set .pcr-app height as child of any class, pcr-picker position is INCORRECT.
(It takes a value of default style 240px)
( here is a demo http://jsfiddle.net/o3e5wqc7/9/ )

2 - Size in percents
I need to set height on .pickr and .pcr-app in percents, there is always position: 0 0 after intialization.
( here is a demo http://jsfiddle.net/o3e5wqc7/10/ )

I hope this is not a feature, but just an annoying little bug :)

Opening page on <iframe> prevents color picker modal to show on mobile devices

Steps to reproduce

  1. Setup a page on a test website that opens the Pickr homepage on an iframe. (I'm using a route on a Ruby on Rails site.)
  2. Open the page on a mobile device browser.
  3. Click on the Pickr button. (Expected: The color picker modal should pop up, but it does not).

Example reproduction

This url opens Pickr's homepage on an iframe:

https://pacific-temple-66916.herokuapp.com/test-color-picker <- No longer available

In my case, it works on Desktop browsers, but not on mobile versions (iOS) of Chrome, Safari & Firefox.

Test variations and other comments

  • I tested it with appendToBody as well with the same results.
  • I noticed that the class containing the visibility trigger is added when I tap the button, so that seems to be working (Although the web inspector was highlighting it on and off as if it was being added then removed then added again, idk). I wanted to keep testing but my mobile web inspector kept crashing for some reason so I could not test it any further.
  • Could this have something to do with my own Rails app's CSP? I might try a different framework later to see if this also occurs.

Environment

Pickr-version: master
Browser-version:
  - iOS Google Chrome (Version: 67.0.3396.87)
  - iOS Safari (Version: Latest?)
  - iOS Firefox (Version: 12.1)
Operating-system: iOS 11.4 (iPhone 7 Plus)

Thanks in advance for this awesome tool! Definitely excited to see where it goes.

Saving behaviour

Love the picker and its simplicity!

Would like the ability to save on change though.

Currently the picker crashes if setColor is called within the onChange event. And there is no way to trigger an event when the picker is closed/hidden, which makes it tricky to achieve the behaviour with the current setup.

Pickr fires "onSave" during construction

Do you want to request a feature or report a bug?

Bug (IMHO)

What is the current behavior?

Pickr fires the onSave event during construction.

If the current behavior is a bug, please provide the steps to reproduce.

Add to gh-page/js/script.js the following lines:

        onSave: function (hsva, instance) {
		console.log("onSave");
	}

Open index.html.

What is the expected behavior?

onSave should not be called (IMHO). It should only be called when the user makes a change.

Your environment:

Pickr-version: master (166ce8d6671be16cf81b7cefa7e29c7b73738490)
Browser-version:  68.0.3440.42 (Official Build) beta (64-bit)
Operating-system:  MacOs

Hex 8 character alpha channel

I suppose you could have the hex value with the alpha channel - 8 digits for web development. You'd have 6 digits with the alpha at 100% or whatever 255? Then if it is less then have an 8 digit hex.

pickr.Show() Not working well

hi
pickr.show not working with options:
useAsButton: true, comparison: false

i can show pickr only by clicking on button! i need to show on INPUT TEXT focus

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.