Skip to content

Commit

Permalink
Replaced 100vh with 100dvh (better for mobiles)
Browse files Browse the repository at this point in the history
  • Loading branch information
salmonb committed Jun 8, 2024
1 parent 2af8758 commit 1324fec
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ public final class HtmlScenePeer extends ScenePeerBase {

public HtmlScenePeer(Scene scene) {
super(scene);
// TODO: see how to replace this with immediate CSS
HtmlUtil.setStyleAttribute(container, "width", "100%");
HtmlUtil.setStyleAttribute(container, "height", "100vh"); // 100% is not good on mobile when the browser navigation bar is hidden, but 100vh works
HtmlUtil.setStyleAttribute(container, "height", "100dvh"); // dvh is better than vh on mobiles (keeps working when navigation bar hides or reappears)
FXProperties.runNowAndOnPropertiesChange(property -> updateContainerFill(), scene.fillProperty());
installMouseListeners();
HtmlSvgNodePeer.installTouchListeners(container, scene);
Expand Down

0 comments on commit 1324fec

Please sign in to comment.