Skip to content

Commit

Permalink
fix #814 Hide dropdowns on 2nd click
Browse files Browse the repository at this point in the history
  • Loading branch information
vegegoku committed Aug 27, 2023
1 parent ea1396a commit 65ab3a8
Show file tree
Hide file tree
Showing 18 changed files with 14 additions and 190 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ public DropdownButton(T button, Menu<V> menu) {
.setAttribute("aria-haspopup", true)
.setAttribute("aria-expanded", true)
.setAttribute("type", "button");
// this.menu.setTargetElement(button).setMenuAppendTarget(body().element());
this.button.addClickListener(evt -> this.menu.open());
this.button.setDropMenu(this.menu);
init(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -550,15 +550,6 @@ public List<T> getRecords() {
public List<T> getDirtyRecords() {
return getRows().stream().map(TableRow::getDirtyRecord).collect(Collectors.toList());
}
//
// @Override
// public void onSelectionChange(TableRow<T> source) {
//
// selectionChangeListeners.forEach(
// selectionChangeListener ->
// selectionChangeListener.onSelectionChanged(getSelectedItems(),
// getSelectedRecords()));
// }

/**
* {@inheritDoc}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,6 @@ public void updateCell() {
DominoElement<HTMLTableCellElement> cellElement = elements.elementOf(cellInfo.getElement());
cellElement.clearElement();

// if (nonNull(columnConfig.getMinWidth())) {
// columnConfig.getHeadElement().style().setMinWidth(columnConfig.getMinWidth());
// }
//
// if (nonNull(columnConfig.getMaxWidth())) {
// columnConfig.getHeadElement().style().setMaxWidth(columnConfig.getMaxWidth());
// }

if (nonNull(columnConfig.getTextAlign())) {
cellElement.addCss(columnConfig.getTextAlign());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,11 @@ public Element asElement(DataTable<T> dataTable) {

columnsIcon.addClickListener(
evt -> {
dropDownMenu.open();
if (dropDownMenu.isOpened()) {
dropDownMenu.close();
} else {
dropDownMenu.open();
}
evt.stopPropagation();
});
return columnsIcon.element();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,47 +23,40 @@
*/
public interface EventType {

// Network Events
/** Constant <code>online</code> */
EventType online = () -> "online";
/** Constant <code>offline</code> */
EventType offline = () -> "offline";

// Focus Events
/** Constant <code>focus</code> */
EventType focus = () -> "focus";
/** Constant <code>blur</code> */
EventType blur = () -> "blur";

// Session History Events
/** Constant <code>pagehide</code> */
EventType pagehide = () -> "pagehide";
/** Constant <code>pageshow</code> */
EventType pageshow = () -> "pageshow";
/** Constant <code>popstate</code> */
EventType popstate = () -> "popstate";

// Form Events
/** Constant <code>reset</code> */
EventType reset = () -> "reset";
/** Constant <code>submit</code> */
EventType submit = () -> "submit";

// Printing Events
/** Constant <code>beforeprint</code> */
EventType beforeprint = () -> "beforeprint";
/** Constant <code>afterprint</code> */
EventType afterprint = () -> "afterprint";

// Text Composition Events
/** Constant <code>compositionstart</code> */
EventType compositionstart = () -> "compositionstart";
/** Constant <code>compositionupdate</code> */
EventType compositionupdate = () -> "compositionupdate";
/** Constant <code>compositionend</code> */
EventType compositionend = () -> "compositionend";

// View Events
/** Constant <code>fullscreenchange</code> */
EventType fullscreenchange = () -> "fullscreenchange";
/** Constant <code>fullscreenerror</code> */
Expand All @@ -73,23 +66,20 @@ public interface EventType {
/** Constant <code>scroll</code> */
EventType scroll = () -> "scroll";

// Clipboard Events
/** Constant <code>cut</code> */
EventType cut = () -> "cut";
/** Constant <code>copy</code> */
EventType copy = () -> "copy";
/** Constant <code>paste</code> */
EventType paste = () -> "paste";

// Keyboard Events
/** Constant <code>keydown</code> */
EventType keydown = () -> "keydown";
/** Constant <code>keypress</code> */
EventType keypress = () -> "keypress";
/** Constant <code>keyup</code> */
EventType keyup = () -> "keyup";

// Mouse Events
/** Constant <code>mouseenter</code> */
EventType mouseenter = () -> "mouseenter";
/** Constant <code>mouseover</code> */
Expand Down Expand Up @@ -119,7 +109,6 @@ public interface EventType {
/** Constant <code>pointerlockerror</code> */
EventType pointerlockerror = () -> "pointerlockerror";

// Drag & Drop Events
/** Constant <code>dragstart</code> */
EventType dragstart = () -> "dragstart";
/** Constant <code>drag</code> */
Expand All @@ -135,7 +124,6 @@ public interface EventType {
/** Constant <code>drop</code> */
EventType drop = () -> "drop";

// Touch Events
/** Constant <code>touchcancel</code> */
EventType touchcancel = () -> "touchcancel";
/** Constant <code>touchend</code> */
Expand All @@ -145,7 +133,6 @@ public interface EventType {
/** Constant <code>touchstart</code> */
EventType touchstart = () -> "touchstart";

// Value Change Events
/** Constant <code>hashchange</code> */
EventType hashchange = () -> "hashchange";
/** Constant <code>input</code> */
Expand All @@ -157,7 +144,6 @@ public interface EventType {
/** Constant <code>search</code> */
EventType search = () -> "search";

// Uncategorized Events
/** Constant <code>invalid</code> */
EventType invalid = () -> "invalid";
/** Constant <code>show</code> */
Expand All @@ -169,11 +155,9 @@ public interface EventType {
/** Constant <code>storage</code> */
EventType storage = () -> "storage";

// Window Events
/** Constant <code>load</code> */
EventType load = () -> "load";

// Page Visibility API Events
/** Constant <code>visibilitychange</code> */
EventType visibilitychange = () -> "visibilitychange";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,6 @@ public C withOption(O option) {
*/
protected abstract C withOption(O option, boolean silent);

// Should be abstract
/**
* doSetValue.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,6 @@ public C withValue(V value, boolean silent) {
return (C) this;
}

// Should be abstract
/**
* doSetValue.
*
Expand Down
2 changes: 0 additions & 2 deletions domino-ui/src/main/java/org/dominokit/domino/ui/grid/Row.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,6 @@ public Row appendChild(Column column) {
return this;
}

// =========================

/**
* span1.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public interface AcceptKeyEvents {
*/
AcceptKeyEvents onBackspace(KeyboardEventOptions options, EventListener backspaceHandler);

// ---------------- handlers ----------------
/**
* On escape button pressed
*
Expand Down
10 changes: 7 additions & 3 deletions domino-ui/src/main/java/org/dominokit/domino/ui/menu/Menu.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,11 @@ public class Menu<V> extends BaseDominoElement<HTMLDivElement, Menu<V>>
targets.get(elementOf(Js.<HTMLElement>uncheckedCast(evt.target)).getDominoId());
}
if (isAutoOpen()) {
open(evt);
if (isOpened() && !isContextMenu()) {
close();
} else {
open(evt);
}
}
};
private final DivElement backArrowContainer;
Expand Down Expand Up @@ -388,9 +392,9 @@ void onItemAdded(AbstractMenuItem<V> menuItem) {
* Appends a menu item to this menu
*
* @param menuGroup {@link org.dominokit.domino.ui.menu.MenuItemsGroup}
* @return same menu instance
* @param groupHandler a {@link org.dominokit.domino.ui.menu.Menu.MenuItemsGroupHandler} object
* @param <I> a I class
* @return same menu instance
*/
public <I extends AbstractMenuItem<V>> Menu<V> appendGroup(
MenuItemsGroup<V> menuGroup, MenuItemsGroupHandler<V, I> groupHandler) {
Expand Down Expand Up @@ -433,8 +437,8 @@ public Menu<V> removeAll() {
/**
* Appends a separator item to this menu, separator will show up as a simple border.
*
* @return same menu instance
* @param separator a {@link org.dominokit.domino.ui.utils.Separator} object
* @return same menu instance
*/
public Menu<V> appendChild(Separator separator) {
this.menuItemsList.appendChild(separator.addCss(dui_menu_separator));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ default void cleanup(Element source) {}
/** Constant <code>TOP_RIGHT</code> */
DropDirection TOP_RIGHT = new TopRightDropDirection();

// -------------------------

/** Constant <code>dui_dd_bottom_left</code> */
CssClass dui_dd_bottom_left = () -> "dui-dd-bottom-left";
/** Constant <code>dui_dd_bottom_middle</code> */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,4 @@ public interface SearchStyles {
CssClass dui_search_bar = () -> "dui-search-bar";
/** Constant <code>dui_search_bar_container</code> */
CssClass dui_search_bar_container = () -> "dui-search-bar-container";

// public static final String search_bar = "search-bar";
// public static final String search_icon = "search-icon";
// public static final String close_search = "close-search";
// public static final String open = "open";
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,11 @@
public class ActiveStep implements StepState {
/** {@inheritDoc} */
@Override
public void apply(StepTracker tracker) {
// tracker.addCss(dui_accent_accent_d_2);
}
public void apply(StepTracker tracker) {}

/** {@inheritDoc} */
@Override
public void cleanUp(StepTracker tracker) {
// tracker
// .removeCss(dui_accent_accent_d_2)
// .withTrackerNode((parent1, node) -> node.removeCss(dui_accent_accent_d_2));
}
public void cleanUp(StepTracker tracker) {}

/** {@inheritDoc} */
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@ default HTMLPictureElement picture() {
return create("picture", HTMLPictureElement.class);
}

// ------------------------------------------------------ content sectioning

/**
* address.
*
Expand Down Expand Up @@ -208,8 +206,6 @@ default HTMLElement section() {
return create("section", HTMLElement.class);
}

// ------------------------------------------------------ text content

/**
* blockquote.
*
Expand Down Expand Up @@ -336,8 +332,6 @@ default HTMLUListElement ul() {
return create("ul", HTMLUListElement.class);
}

// ------------------------------------------------------ inline text semantics

/**
* a.
*
Expand Down Expand Up @@ -527,8 +521,6 @@ default HTMLElement wbr() {
return create("wbr", HTMLElement.class);
}

// ------------------------------------------------------ image and multimedia

/**
* area.
*
Expand Down Expand Up @@ -595,8 +587,6 @@ default HTMLVideoElement video() {
return create("video", HTMLVideoElement.class);
}

// ------------------------------------------------------ embedded content

/**
* canvas.
*
Expand Down Expand Up @@ -663,8 +653,6 @@ default HTMLSourceElement source() {
return create("source", HTMLSourceElement.class);
}

// ------------------------------------------------------ scripting

/**
* noscript.
*
Expand All @@ -683,8 +671,6 @@ default HTMLScriptElement script() {
return create("script", HTMLScriptElement.class);
}

// ------------------------------------------------------ demarcating edits

/**
* del.
*
Expand All @@ -703,8 +689,6 @@ default HTMLModElement ins() {
return create("ins", HTMLModElement.class);
}

// ------------------------------------------------------ table content

/**
* caption.
*
Expand Down Expand Up @@ -795,8 +779,6 @@ default HTMLTableRowElement tr() {
return create("tr", HTMLTableRowElement.class);
}

// ------------------------------------------------------ forms

/**
* button.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
import org.dominokit.domino.ui.i18n.DefaultDominoUILabels;
import org.dominokit.domino.ui.i18n.DominoUILabels;

// import org.dominokit.domino.ui.tree.TreeItem;

/**
* This class provides global configuration for form fields
*
Expand Down
Loading

0 comments on commit 65ab3a8

Please sign in to comment.