[SOLVED] SelectBox and modal bug

Hello,

when a window is set on modal, the children wich need to display some other elements, appears behind the window.

You can see that the labels are correct but the background of the SelectBox is behind the window and inputs events are not eaten.

Otherwise, when a window is set as modal, the elements outside of the window bounds are usable, it is used to be like that or it is a mistake?

@jonesadev said: Hello,

when a window is set on modal, the children wich need to display some other elements, appears behind the window.

You can see that the labels are correct but the background of the SelectBox is behind the window and inputs events are not eaten.

Otherwise, when a window is set as modal, the elements outside of the window bounds are usable, it is used to be like that or it is a mistake?

How are you setting the window modal?

I extends a DialogBox and in the constructor call :

[java]
setWindowTitle(“Server filters”);
setIsModal(true);
setIsMovable(false);
setIsResizable(false);
getDragBar().setIsMovable(false);

ScrollArea _body = getMessageArea();
gameMode = new SelectBox(screen, new Vector2f(100f + leftPadding, 125f + vSpacing), new Vector2f(150f, 25f)) {
@Override
public void onChange(int selectedIndex, Object value) {
setSelectedIndex(selectedIndex);
}
};
for(GameMode _mode : GameMode.values())
gameMode.addListItem(_mode.getName(), _mode);

    _body.addChild(gameMode);

[/java]

@jonesadev said: I extends a DialogBox and in the constructor call :

[java]
setWindowTitle(“Server filters”);
setIsModal(true);
setIsMovable(false);
setIsResizable(false);
getDragBar().setIsMovable(false);[/java]

Not sure if this will solve the posted issue, however… instead of using setIsModal(true), trying using element.showAsModal(boolean useEffect);

This will ensure that the window is displayed as a modal window… however, there still may be an issue with the dropdown at that point. Let me know if the dropdown still misbehaves and we’ll try and fix that next.

Thank you it does exactly want I wanted.

1 Like