private void removeTag(Element listItem) {
        // we can remove tag only when mode allows it
        if (mode != Mode.READ) {

            // remove tag from inner tag list
            ItemTag t = null;
            for (ItemTag itemTag : getInputTags()) {
                if (itemTag.getListItem().equals(listItem)) {
                    t = itemTag;
                    break;
                }
            }
            if (t == null) {
                throw new NullPointerException("List item element that has to be removed was not found!");
            }
            getInputTags().remove(t);

            // make next sibling active
            shiftFocusRight(listItem);

            // remove tag from DOM
            listItem.removeFromParent();
        }
    }