From 16b8d8a132bb84c87e2e351d42d4e89314ad13ea Mon Sep 17 00:00:00 2001 From: Florian Hotze Date: Sat, 25 Feb 2023 14:36:35 +0100 Subject: [PATCH 1/3] Fix widget action `options` too large on iPhone in openHAB app Signed-off-by: Florian Hotze --- bundles/org.openhab.ui/web/src/css/app.styl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bundles/org.openhab.ui/web/src/css/app.styl b/bundles/org.openhab.ui/web/src/css/app.styl index 36ea1889d6..2c4cc85872 100644 --- a/bundles/org.openhab.ui/web/src/css/app.styl +++ b/bundles/org.openhab.ui/web/src/css/app.styl @@ -140,6 +140,14 @@ html .delete --f7-bars-link-color #ff3b30 +@media (orientation: portrait) + .ios .actions-modal + max-height: calc(100% - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) + +@media (orientation: landscape) + .ios .actions-modal + max-height: calc(100% - env(safe-area-inset-left, 0px)) + .md .contextual-toolbar --f7-theme-color #474747 --f7-bars-bg-color #474747 From ab2b639b74f81a079b0512bc1f2ab0aa4a8aa755 Mon Sep 17 00:00:00 2001 From: Florian Hotze Date: Sat, 25 Feb 2023 15:01:36 +0100 Subject: [PATCH 2/3] Trim whitespaces in widget action `options` Fixes #1210 and should have no negative side effects because having whitespaces at start or end of a command is very unlikely to happen, and for the label it doesn't matter at all. Signed-off-by: Florian Hotze --- .../web/src/components/widgets/widget-actions.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bundles/org.openhab.ui/web/src/components/widgets/widget-actions.js b/bundles/org.openhab.ui/web/src/components/widgets/widget-actions.js index 4a05cd56c7..1a8f600c8a 100644 --- a/bundles/org.openhab.ui/web/src/components/widgets/widget-actions.js +++ b/bundles/org.openhab.ui/web/src/components/widgets/widget-actions.js @@ -103,12 +103,12 @@ export const actionsMixin = { const actionsPromise = new Promise((resolve, reject) => { if (actionCommandOptions && typeof actionCommandOptions === 'string') { resolve(actionCommandOptions.split(',').map((o) => { - const parts = o.split('=') + const parts = o.trim().split('=') return { - text: parts[1] || parts[0], + text: parts[1].trim() || parts[0].trim(), color: 'blue', onClick: () => { - this.$store.dispatch('sendCommand', { itemName: actionCommandOptionsItem, cmd: parts[0] }) + this.$store.dispatch('sendCommand', { itemName: actionCommandOptionsItem, cmd: parts[0].trim() }) .then(() => this.showActionFeedback(prefix, actionConfig)) } } From 653d8131f30055a49812ba8e1f292b30e9617996 Mon Sep 17 00:00:00 2001 From: Florian Hotze Date: Sat, 25 Feb 2023 15:14:49 +0100 Subject: [PATCH 3/3] Add comment for style fix to app.styl Signed-off-by: Florian Hotze --- bundles/org.openhab.ui/web/src/css/app.styl | 1 + 1 file changed, 1 insertion(+) diff --git a/bundles/org.openhab.ui/web/src/css/app.styl b/bundles/org.openhab.ui/web/src/css/app.styl index 2c4cc85872..81ceb61715 100644 --- a/bundles/org.openhab.ui/web/src/css/app.styl +++ b/bundles/org.openhab.ui/web/src/css/app.styl @@ -140,6 +140,7 @@ html .delete --f7-bars-link-color #ff3b30 +// Fix actions-modal/popup is placed behind the notch or outside of the screen on iPhone in openHAB iOS app @media (orientation: portrait) .ios .actions-modal max-height: calc(100% - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px))