Skip to content

Commit

Permalink
fix #967 Select sends incorrect oldvalue when clearing, some visual e…
Browse files Browse the repository at this point in the history
…nhacements
  • Loading branch information
vegegoku committed Oct 6, 2024
1 parent 89d1c3e commit 1505df8
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
import org.dominokit.domino.ui.forms.IntegerBox;
import org.dominokit.domino.ui.forms.LongBox;
import org.dominokit.domino.ui.forms.ShortBox;
import org.dominokit.domino.ui.icons.Icon;
import org.dominokit.domino.ui.icons.lib.Icons;

/**
* Implementations of this interface can be used to configure defaults for form fields components
Expand Down Expand Up @@ -123,6 +125,15 @@ default boolean isTabFocusSelectArrowEnabled() {
return false;
}

/**
* Use this method to change the default icon for clearable form fields.
*
* @return Icon for clearable fields clear value action.
*/
default Icon<?> clearableInputDefaultIcon() {
return Icons.delete();
}

/**
* Use this method to define the default position of the field label, top or left
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,9 @@ public AbstractSelect() {

appendChild(
PrimaryAddOn.of(
Icons.delete()
config()
.getUIConfig()
.clearableInputDefaultIcon()
.addCss(dui_form_select_clear)
.clickable()
.addClickListener(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import org.dominokit.domino.ui.forms.AbstractFormElement;
import org.dominokit.domino.ui.forms.AutoValidator;
import org.dominokit.domino.ui.forms.HasInputElement;
import org.dominokit.domino.ui.icons.lib.Icons;
import org.dominokit.domino.ui.loaders.Loader;
import org.dominokit.domino.ui.loaders.LoaderEffect;
import org.dominokit.domino.ui.menu.AbstractMenuItem;
Expand Down Expand Up @@ -166,7 +165,9 @@ public AbstractSuggestBox(SuggestionsStore<T, E, O> store) {

appendChild(
PrimaryAddOn.of(
Icons.delete()
config()
.getUIConfig()
.clearableInputDefaultIcon()
.addCss(dui_form_select_clear)
.clickable()
.addClickListener(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ protected void onOptionDeselected(SelectOption<V> option, boolean silent) {
*/
@Override
public V getValue() {
if (nonNull(this.selectedOption)) {
if (nonNull(this.selectedOption) && this.selectedOption.getMenuItem().isSelected()) {
return this.selectedOption.getValue();
}
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2039,7 +2039,7 @@ public T blur() {
*/
@Editor.Ignore
public T setTooltip(String text) {
return setTooltip(text, DropDirection.TOP_MIDDLE);
return setTooltip(text, DropDirection.BEST_SIDE_UP_DOWN);
}

/**
Expand All @@ -2063,7 +2063,7 @@ public T setTooltip(String text, DropDirection position) {
*/
@Editor.Ignore
public T setTooltip(Node node) {
return setTooltip(node, DropDirection.TOP_MIDDLE);
return setTooltip(node, DropDirection.BEST_SIDE_UP_DOWN);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
padding: var(--dui-tab-anchor-padding);
border-radius: inherit;
text-decoration: var(--dui-tab-anchor-text-decoration);
outline: none;
}

.dui[class*="dui-bg-"] .dui-tab-anchor:hover,
Expand Down

0 comments on commit 1505df8

Please sign in to comment.