flowingcode / chipfieldaddon Goto Github PK
View Code? Open in Web Editor NEWVaadin Flow integration of https://github.com/ThomasCybulski/paper-chip
License: Apache License 2.0
Vaadin Flow integration of https://github.com/ThomasCybulski/paper-chip
License: Apache License 2.0
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.
Add integration test for #31
paper-chip-input-autocomplete
should extend ThemableMixin(PolymerElement)
so that custom styles can be provided with @CssImport
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
flow-build-info.json is a generated file that shouldn't be included in add-ons
$server.allowAdditionalItems(true);
chipfield.sendKeys(ADDITIONAL, Keys.ENTER);
assertThat(chipfield.getValue(), Matchers.empty());
assertThat($server.getValue(), Matchers.empty());
Expected: an empty collection
but: <[Additional]>
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:
From thread in Vaadin Directory, Julien Nicoulaud wrote:
โ I can't find a way to use this component inside a grid cell, the dropdown menu always gets clipped at the cell boundary even if I use a global CSS rule * {overflow: visible;}.
Expected behavior:
removeSelectedItem
actually removes the item Venus.add(new Button("No Venus", ev -> {
chf.removeSelectedItem(venus);
}));
Observed behavior:
removeSelectedItem
Mars
.When a newItemHandler is configured, typing an existing label and pressing enter selects that value.
If there is no newItemHandler ("restricted mode"), the user has to select the value from the dropdown. It cannot be selected by typing enter.
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}");
Add unit test for feature #26
findItemByLabel
searches the available items, but when a new item is added, the available items are not updated with the new one, thus findItemByLabel will not retrieve them.
Remove bintray.com/webjars repository, which is going to be shutdown.
The bintray repository contained webjars immediately after generation, while they were being published in Maven central.
See https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/
testAdditionalItemCreatedListenerFromServer
testAdditionalItemRemovedListenerFromServer
testItemCreatedListenerFromServer
testItemRemovedListenerFromServer
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.
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
From thread in Vaadin Directory, Matteo De Franceschi wrote:
I'm not able to use the "setValue" method. It seems it is ignored.
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).
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.
$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
We want to use the Chip component outside of the ChipField component, all it would it take is changing the visibility of Chip to public.
Removing a chipfield with values from the layout and adding it again does not show the chips of the values it still has.
The field shows as empty although internally it still has its values. (verified with getValue())
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 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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.