File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
domino-ui/src/main/java/org/dominokit/domino/ui/menu/direction Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 2525
2626/** DropDirection interface. */
2727public interface DropDirection {
28+
29+ String DUI_POSITION_FALLBACK = "dui-position-fallback" ;
30+
2831 /**
2932 * init.
3033 *
@@ -53,15 +56,14 @@ default void cleanSelf(Element source) {}
5356
5457 default DropDirection fallBackPosition (DropDirectionContext context , SpaceChecker spaceChecker ) {
5558 DominoElement <Element > source = elementOf (context .getSource ());
56- if (dui_menu .isAppliedTo (context .getSource ())
57- && !source .hasAttribute ("dui-position-fallback" )) {
59+ if (dui_menu .isAppliedTo (context .getSource ()) && !source .hasAttribute (DUI_POSITION_FALLBACK )) {
5860 source .setCssProperty (spaceChecker .getMaximumSideSpaceProperty ());
5961 source .setCssProperty (spaceChecker .getMaximumVerticalSpaceProperty ());
6062
6163 context .newSpaceChecker ();
6264
6365 DropDirection position = position (context );
64- source .setAttribute ("dui-position-fallback" , true );
66+ source .setAttribute (DUI_POSITION_FALLBACK , true );
6567 return position ;
6668 }
6769 return MIDDLE_SCREEN .position (context );
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ public class MiddleOfScreenDropDirection implements DropDirection {
3131 public DropDirection position (DropDirectionContext context ) {
3232 Element source = context .getSource ();
3333 Element target = context .getTarget ();
34+ source .removeAttribute (DUI_POSITION_FALLBACK );
3435 dui_flex_col_reverse .remove (source );
3536 DOMRect sourceRect = source .getBoundingClientRect ();
3637
You can’t perform that action at this time.
0 commit comments