Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screen height on tablet vs keyboard #1162

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@
format("woff"); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}

/* Needed for the fallbacks below */
@supports (height: -webkit-fill-available) {
:root {
--webkit-vhh: -webkit-fill-available;
}
}

:root {
/* Seems to fix a Safari glitch: https://github.com/microbit-foundation/python-editor-v3/issues/369 */
font-size: 16px;
Expand All @@ -34,9 +27,9 @@ body,
.WorkbenchContainer,
.Workbench {
width: 100%;
/* --ios-vvh set by VisualViewPortCSSVariables on iOS only. */
height: var(--ios-vvh, var(--webkit-vvh, 100vh));
}
body {
overflow: hidden;
height: 100%;
/* 516px is the min height of the sidebar */
min-height: 516px;
/* 372px is the sidebar width + simulator width */
min-width: 372px;
}
2 changes: 0 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { polyfill } from "mobile-drag-drop";
import { useEffect } from "react";
import "./App.css";
import { DialogProvider } from "./common/use-dialogs";
import VisualViewPortCSSVariables from "./common/VisualViewportCSSVariables";
import { deployment, useDeployment } from "./deployment";
import { MicrobitWebUSBConnection } from "./device/webusb";
import { DeviceContextProvider } from "./device/device-hooks";
Expand Down Expand Up @@ -65,7 +64,6 @@ const App = () => {
const { ConsentProvider } = deployment.compliance;
return (
<>
<VisualViewPortCSSVariables />
<ChakraProvider theme={deployment.chakraTheme}>
<LoggingProvider value={logging}>
<SettingsProvider>
Expand Down
3 changes: 2 additions & 1 deletion src/common/SplitView/SplitViewSized.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
*
* SPDX-License-Identifier: MIT
*/
import { Box } from "@chakra-ui/layout";
import { createRef, useEffect } from "react";
import { dimensionPropName, useSplitViewContext } from "./context";
import { Box } from "@chakra-ui/layout";

interface SizedPaneProps {
children: JSX.Element;
Expand Down Expand Up @@ -38,6 +38,7 @@ const SplitViewSized = ({ children }: SizedPaneProps) => {
return (
<Box
pointerEvents={dragging ? "none" : "unset"}
display={mode === "collapsed" ? "none" : undefined}
visibility={mode === "collapsed" ? "hidden" : undefined}
Comment on lines +41 to 42
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes some of the extra space around the UI that is added when the simulator is collapsed. visibility: hidden does not change the layout of the document, display: none does.

ref={ref}
>
Expand Down
52 changes: 0 additions & 52 deletions src/common/VisualViewportCSSVariables.tsx
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed since we are aiming to have the keyboard overlay the UI instead of having a shifting action bar

This file was deleted.

Loading