Code Monkey home page Code Monkey logo

colorpicker's People

Contributors

tatulund avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

colorpicker's Issues

Set a default value

When an invalid string is entered, the color picker becomes invalid and its value becomes null. Is there a way to make the color picker default to a particular color when invalid input is entered, so that the color picker should never actually be in an invalid state?

I tried something like:

colorPicker.addValueChangeListener(event -> {
  if (event.getValue() == null) {
    colorPicker.setValue(defaultColor);
  }
  colorPicker.setInvalid(false);
});

but this didn't have the desired effect. The color picker did switch to the default color, but it also remained invalid.

I also tried:

binder.forField(colorPicker)
  .withConverter(pres -> pres == null ? defaultColor : pres, model -> model == null ? defaultColor : model)
  .bind(...)

but this didn't work either - the color picker still appeared invalid, and the color swatch on the left was black instead of the default color.

Thanks for your help, and thanks for creating this component! It's really handy.

When changing values with a preset, the state does not change.

Changing the color with the colorpicker changes the state.

However, if I use a preset to change the color, the state does not change.

image
image

version

        <dependency>
            <groupId>org.vaadin.addons.tatu</groupId>
            <artifactId>colorpicker</artifactId>
            <version>1.3.3</version>
        </dependency>

ColorPicker does not load/is visible on Vaadin 24.1.7

I have been trying tt get this to work with Vaadin 24.1.7

I have implemented it as per the code displayed in the Vaadin directory for the add-on.

Once the page is up and running and I inspect where the color picker should be all I see is (As per the screenshot)

NoColorPicker

I have included the correct version as per the POM file

POM

I have tried to do a full clean of the build and re-implement but I still run into this issue.

Are you able to test against this version and see if it works ? Or see what could be causing this issue ?

Show rendering of selected value?

  1. The color picker only shows the string captions for colors when the combo-box is dropped down. Can it be made to show the rendered caption of the selected color? Right now the color box has the right color, but the text field is left blank.

  2. Also, would it be possible to optionally allow custom rendering code to render the caption string? Or perhaps allow it to be a component? We have a use case where we want more formatting than just a simple text string insertion.

Thank you much.

Calling setReadOnly(false) makes color picker input field read-only

Calling setReadOnly(false) on a ColorPicker instance results in this state:

kép

This seems to be caused by css rules that check only for the existence of the attribute, like this one:

        :host([readonly]) #colorpicker {
            background: transparent; 
            border: 1px dashed var(--lumo-contrast-30pct);
            pointer-events: none;
        }

Null value

Would be nice to have a null value like this.

color-picker-null

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.