Skip to content

Commit

Permalink
fix #985 Tooltip Clipped Upon Icon Click
Browse files Browse the repository at this point in the history
  • Loading branch information
vegegoku committed Dec 8, 2024
1 parent 4e46aab commit 7d0c7f0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

public interface PopoverConfig extends ZIndexConfig {

default DropDirection getDefaultDropDirection() {
default DropDirection getDefaultPopoverDropDirection() {
return DropDirection.BEST_MIDDLE_UP_DOWN;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public BasePopover(Element target) {
.appendChild(body = div().addCss(dui_popover_body)));

init((T) this);
this.popupPosition = getConfig().getDefaultDropDirection();
this.popupPosition = getConfig().getDefaultPopoverDropDirection();
this.closeOnBlur = getConfig().closeOnBlur();
this.openDelay = getConfig().openDelay();

Expand Down Expand Up @@ -317,9 +317,14 @@ public void discard() {
public T setPosition(DropDirection position) {
this.popupPosition.cleanup(this.element());
this.popupPosition = position;
doPosition();
return (T) this;
}

public DropDirection getPopupPosition() {
return popupPosition;
}

/**
* Specifies whether the popover should automatically close when other popovers are opened.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2232,7 +2232,11 @@ public T blur() {
*/
@Editor.Ignore
public T setTooltip(String text) {
return setTooltip(text, DropDirection.BEST_SIDE_UP_DOWN);
return setTooltip(
text,
isNull(this.tooltip)
? config().getUIConfig().getDefaultPopoverDropDirection()
: tooltip.getPopupPosition());
}

/**
Expand All @@ -2256,7 +2260,11 @@ public T setTooltip(String text, DropDirection position) {
*/
@Editor.Ignore
public T setTooltip(Node node) {
return setTooltip(node, DropDirection.BEST_SIDE_UP_DOWN);
return setTooltip(
node,
isNull(this.tooltip)
? config().getUIConfig().getDefaultPopoverDropDirection()
: tooltip.getPopupPosition());
}

/**
Expand Down

0 comments on commit 7d0c7f0

Please sign in to comment.