How to remove an item from a paper-listbox? - listbox

I can add an item to a paper-listbox with
Polymer.dom($['mylistbox']).append(paperItem);
However I'm having trouble deleting it from the list afterwards. I tried:
paperItem.remove();
That initially makes it dissapear, but it appears again after selecting another item in the list. How do I remove a paper-item from a listbox?

Polymer.dom($['mylistbox']).removeChild(paperItem);

Related

How to remove a selected item on KeyDown event in PaperJS

First steps with PaperJS. I realized this sketch and this video to describe the issue. As you can see in the video, drawing, for example, three items, and moving over them to select one and pressing the "d" key on keybord, it is possible to remove just the last added and selected item, but not the previous ones. If you start from the first or second item of the three added, the alert is not even triggered.
The wanted beaviour would be instead to select the event.item.selected (moving on it with the mouse) and remove just the selected one by clicking the "d" key on keyboard.
Thank you for your help
Your issue is that after removing the first path, your path variable no longer points to nothing.
So the next time you hit the delete key, you no longer know the selected path.
What you should do instead is storing the currently selected path into another variable and use it instead.
Here's a corrected sketch based on your code, demonstrating this.

Drag and Drop: by using copyArrayItem() the dragged item should not be removed from start array while drop Angular 8

I have a list of items from where I drag an item and drop it into another list. I'm using copyArrayItem() method from Angular to not remove the item from the previous array.
I start dragging, the item is within the previous array: the placeholder from that item shows up.
Start dragging, placeholder shows up
I'm leaving the previous array: the placeholder/dragged item disappears (I want that the placeholder/dragged item stays) -> the start array has minus 1 items.
Placeholder disappears, what I don't want
I'm on the target array: a placeholder appears in a target array.
I'm dropping the item: item appears now in the start and target array.
After more research I've found an open issue about that problem:
https://github.com/angular/components/issues/13906
and there I've found suggestions from participants:
https://stackblitz.com/edit/angular-krmecd?file=src%2Fapp%2Fapp.component.ts
This example with workaround helped me to solve this problem:
https://stackblitz.com/edit/angular-o8exzv-jauhhi?file=src%2Fapp%2Fcdk-drag-drop-connected-sorting-example.html
Maybe this information will be useful for someone.

Appium doesn't update it's view in list element and subelements

I am working on iOS native app and when trying to read from tableView/tableCells I have a problem getting the updated values. At the first time i enter the page/screen I can see all cells. But , if i create an action that adds another cell to the table view when I try to get the list of cells I see an empty list.
Also, When i change a subelement in that cell I can't see the changed sub element both in inspector and in the code.
I tried switching to a different page and also changing tabs in that page and reread the table/cell and subelements but it didn't help.
I've had this issue before. There is no actual reload elements kind of function that I've seen. However a workaround I've found that works is to simply find an element that exists and it'll reload the elements after it does that.
For example:
yourMethodThatLoadsNewElements();
driver.findElementBy(pathToElementThatExistedBefore);
driver.findElementBy(pathToElementThatWasJustLoaded);

rich:panelMenu deselect

Here's the situation:
I have two code>rich:PanelMenu on the same page menuA and menuB.
When I click an item on menuA the item is selected, fine. Now if I click on a item on menuB the item on menuB is selected, but obviously the selection on menuA is still active.
The question is: How i reset the selection on menuA?
ok, found it! I was looking for menuA.selectedChild("") but now apparently is setValue(), so menuA.setValue("") will do the trick.

tagcompletion like stackoverflow

Working example
Bug
add an item that exists in the list
add an item that doesn't exist in the list
add an item that exists in the list by clicking arrow key or clicking an item with mouse
notice that all items are erased and everything starts over.
I am building this on top of a solution provided to me in another question. I've taken the code from that example and modified to my needs. however, now I am having the issue stated above.
What can I do to avoid having the list erase all items when a new item is added by clicking down arrow key after a non existent item is added.
Add the following to the options object you pass the autocomplete widget:
focus: function() { return false; }
From the docs on focus:
Canceling this event prevents the
value from being updated, but does not
prevent the menu item from being
focused.
Here's your example without the bug: http://jsbin.com/oquda3/4

Resources