few textfield improvements
This commit is contained in:
1 parent
0e65b8c446
commit
15ce86d6f3
3 files changed
+20
-2
No files matched your search
+18
-1
@@ -26,6 +26,7 @@ export default function Main() {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!hasAttachedListerner && step > 0) {
|
if (!hasAttachedListerner && step > 0) {
|
||||||
|
setHasAttachedListener(true);
|
||||||
const doFullscreen = () => {
|
const doFullscreen = () => {
|
||||||
if (screenfull.isEnabled) {
|
if (screenfull.isEnabled) {
|
||||||
screenfull.request();
|
screenfull.request();
|
||||||
@@ -34,7 +35,23 @@ export default function Main() {
|
|||||||
window.addEventListener("click", () => {
|
window.addEventListener("click", () => {
|
||||||
doFullscreen();
|
doFullscreen();
|
||||||
});
|
});
|
||||||
setHasAttachedListener(true);
|
if (window.visualViewport) {
|
||||||
|
const handleResize = () => {
|
||||||
|
const keyboardHeight = window.innerHeight - window.visualViewport.height;
|
||||||
|
const appContainer = document.querySelector('#app');
|
||||||
|
if (appContainer) {
|
||||||
|
appContainer.style.paddingBottom = keyboardHeight > 0 ? `${keyboardHeight}px` : '0px';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (document.activeElement && keyboardHeight > 0) {
|
||||||
|
document.activeElement.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
window.visualViewport.addEventListener('resize', handleResize);
|
||||||
|
window.visualViewport.addEventListener('scroll', handleResize);
|
||||||
|
}
|
||||||
|
|
||||||
doFullscreen();
|
doFullscreen();
|
||||||
}
|
}
|
||||||
}, [step, hasAttachedListerner, setHasAttachedListener]);
|
}, [step, hasAttachedListerner, setHasAttachedListener]);
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
.content {
|
.content {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
max-height: 50dvh;
|
max-height: 50dvh;
|
||||||
|
padding-bottom: 15dvh;
|
||||||
p {
|
p {
|
||||||
font-size: 1.3rem;
|
font-size: 1.3rem;
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
|
|||||||
+1
-1
@@ -16,4 +16,4 @@ const isDev = process.env.NODE_ENV === "development";
|
|||||||
|
|
||||||
export const HTTP_SCHEME = isDev ? "http" : "https";
|
export const HTTP_SCHEME = isDev ? "http" : "https";
|
||||||
export const WS_SCHEME = isDev ? "ws" : "wss";
|
export const WS_SCHEME = isDev ? "ws" : "wss";
|
||||||
export const API_PREFIX = isDev ? "10.8.0.23:8080" : "api.excaliburs-erben.de";
|
export const API_PREFIX = isDev ? "192.168.0.110:8080" : "api.excaliburs-erben.de";
|
||||||
Reference in new issue
Block a user