Giter Club home page Giter Club logo

chipfieldaddon's People

Contributors

flang avatar flowingcodeci avatar javier-godoy avatar lucascapicotto avatar mlopezfc avatar ngonzalezpazfc avatar paodb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

chipfieldaddon's Issues

Updating the itemLabelGenerator has no effect on chips

Observed behavior:
After updating the itemLabelGenerator, existing chips keep the label that had been generated with the older itemLabelGenerator.

Expected behavior:
Updating the itemLabelGenerator should update the labels of existing items.

public void setChipLabelGenerator(ItemLabelGenerator<T> itemLabelGenerator) {
this.itemLabelGenerator = itemLabelGenerator;
}

Add theme support

paper-chip-input-autocomplete should extend ThemableMixin(PolymerElement) so that custom styles can be provided with @CssImport

How to get the chip Object on delete / click

Hi, at the moment when a Chip is clicked or deleted, I can get the chip label by the event.getLabe().

In my case I pass an objet to the chipField " ChipField....."
How can I get the MyObject on click / delete ?

Thanks

testAdditionalItemWithNoHandler is failing

	$server.allowAdditionalItems(true);
	chipfield.sendKeys(ADDITIONAL, Keys.ENTER);
	assertThat(chipfield.getValue(), Matchers.empty());
	assertThat($server.getValue(), Matchers.empty());
Expected: an empty collection
     but: <[Additional]>

ValueChangeListener not working on deleting chips

As far as I tested, the problem occurs only while deleting elements. The valueChangeListener does not catch the event in these cases, neither having a DataProvider nor using setAvailableItems method:

  • Removing a chip that was added programatically via setValue method.
  • Removing a new created chip, not provided by the DataProvider.

removeSelectedItem doesn't work as expected

Expected behavior:

  • There are two items: Mars and Venus
  • Calling removeSelectedItem actually removes the item Venus.
add(new Button("No Venus", ev -> {
    chf.removeSelectedItem(venus);
}));

chipfieldvenus

Observed behavior:

  • The Venus is not removed after calling removeSelectedItem
  • After removing Mars, a new chip appears with label "1"
  • When retrieving the value it correctly shows Mars.

Validation pattern not working

Setting a validation pattern with setValidationPattern(regex) does not work. Chips are displayed even if their label does not match the pattern

Vaadin Flow 12

Steps to reproduce:

ChipField<String> chf = new ChipField<>("Kzz");
chf.setAllowedPattern("[a-zA-Z]");
chf.setValidationErrorMessage("Some Error");
chf.setValidationPattern("[a-zA-Z]{2,6}");

Support adding additional items through setValue

setValue accepts items (and adds them to both the model and presentation value) even when those items are not present in the DataProvider. If additional items are allowed, this case should be handled as if processing a chip-created created event. If additional items are not allowed, then items not in the DataProvider should be silently discarded.

Add click event listener

Hi, is there a way to catch the click event ?

So, when a user click on a chip, we can do something, like show the chip detail or edit the chip data.

Thanks

setValue is ignored

From thread in Vaadin Directory, Matteo De Franceschi wrote:

I'm not able to use the "setValue" method. It seems it is ignored.

The component looks like editable in read-only mode

After fixing #34, now items are not deleted in the back-end. However, one or more items can still disappear for a split second when clicking the close button or backspacing (even though they are correctly returned into the UI after processing the events).

There are also: a close button, a focus indicator (blue underline) and a hand cursor, which seem to indicate that the user can interact with the compent (but they can't. because the component is in read-only mode).

delete

Among other things, this issue is caused because the readonly setting only affects the paper-input part, but backspace is handled by paper-chip-input-autocomplete (which doesn't consider whether read-only mode is set).

Perhaps, we can achieve a better UX by treating readonly as "disabled" (which is correctly implemented by the client-side component) but with normal opacity.
image

testAdditionalItemRemovedListenerFromClient is failing

    $server.allowAdditionalItems(true);
    $server.useNewItemHandler(true);
    $server.addItemRemovedListener();

    $server.setValue(ADDITIONAL);
    chipfield.sendKeys(Keys.BACK_SPACE);
    assertThat($server.getLastRemovedItem(), Matchers.is(ADDITIONAL));
Expected: is "Additional"
     but: was null

Component null parameter

When accessing the demo, a javascript error sign shows up saying "(TypeError): $0 is null" in firefox or "(TypeError): Cannot read property 'allowDuplicates' of null" in chrome.
The console logs this error:
The error has occurred in the JS code: '$0, $1, (function _appendChipWithoutEvent() { if ($0.allowDuplicates) { $0.push('items', $1); } else if ($0.items.indexOf($1) == -1) { $0.push('items', $1); } $0.required = false; $0.autoValidate = false; $0._value = ''; }) ()'

I could not find where that method is, but after testing the demo I found that the error occurs when the "DisabledDemo" is available at the same time that any of these two other demos is available too: "RestrictedDemo", "DataProviderDemo". With the "BinderDemo" or only the "DisabledDemo" available, the error does not show up.

Setting readonly still allows deleting chips

Setting readonly on the chipfield still allows deleting chips through the close button when the field is setClosable(true) and with the backspace button.
The expected behaviour would be to hide/gray out and disable the close buttons when the field is put to readonly (directly or through the binder). Also the backspace button should not allow to remove chips.

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.