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

[Main UI] screen.viewAreaWidth not updating / working #2929

Closed
MatzeMuc86 opened this issue Dec 18, 2024 · 5 comments · Fixed by #2933
Closed

[Main UI] screen.viewAreaWidth not updating / working #2929

MatzeMuc86 opened this issue Dec 18, 2024 · 5 comments · Fixed by #2933
Labels
bug Something isn't working main ui Main UI

Comments

@MatzeMuc86
Copy link

The problem

Using screen.viewAreaWidth within custom widgets. With Opdateing from OH 4.2.2 to OH 4.3.0 on Docker the functions causes issues in custom widgets. For better understanding, I generated a specific test widget and test page.

Until OH 4.2.2screen.viewAreaWidth reacted live on changes of screen width (e.g. when re-sizing browser windows). This stoped now as one can see in the GIF. Neither reloading page (URL + ENTER) nor F5 work. Only clicking the link in OH menu reloads current values once.

explorer_UIVKL3bS8v

Test Widget

uid: Cell_Test
tags: []
props:
  parameters:
    - description: HEX or rgba
      label: Backgroundcolor
      name: bgcolor
      required: false
      type: TEXT
    - description: Page which will be opened as popup
      label: Page ID
      name: page
      required: false
timestamp: Dec 18, 2024, 11:42:39 AM
component: f7-card
config:
  title: = (screen.viewAreaWidth) + " Title"
slots:
  content:
    - component: Label
      config:
        text: = (screen.viewAreaWidth) + " Label"

Test Page

config:
  label: test1234
  sidebar: true
blocks:
  - component: oh-block
    config: {}
    slots:
      default:
        - component: oh-grid-row
          config: {}
          slots:
            default:
              - component: oh-grid-col
                config: {}
                slots:
                  default:
                    - component: widget:Cell_Test
                      config: {}
masonry: []
grid: []
canvas: []
@MatzeMuc86 MatzeMuc86 added bug Something isn't working main ui Main UI labels Dec 18, 2024
florian-h05 added a commit to florian-h05/openhab-webui that referenced this issue Dec 19, 2024
Fixes openhab#2929.

Signed-off-by: Florian Hotze <dev@florianhotze.com>
@florian-h05
Copy link
Contributor

I have just checked (both by testing and reading the code) and it did never react to screen resizing live in the past, so this is no regression from 4.3.0.
Anyway, 5.0 will fix this.

florian-h05 added a commit that referenced this issue Dec 22, 2024
…ted (#2933)

Fixes #2929.

Signed-off-by: Florian Hotze <dev@florianhotze.com>
@MatzeMuc86
Copy link
Author

You are partly right, I quickly tested it on 4.2.2 amd it never reacted on live changes but it reacted on loading page / reloading URL. At least loading correct value when entering page is crucial for me and a regression as I use this function on home screen which is broken on 4.3. now.

Maybe there is a change to bring loading value on page access back at leas on 4.3?

@florian-h05
Copy link
Contributor

I can backport #2933 to 4.3.x so it gets fixed there 👍
This also makes it update on live changes.

florian-h05 added a commit that referenced this issue Dec 22, 2024
…ted (#2933)

Fixes #2929.

Signed-off-by: Florian Hotze <dev@florianhotze.com>
(cherry picked from commit 0ead7b8)
@MatzeMuc86
Copy link
Author

I can backport #2933 to 4.3.x so it gets fixed there 👍 This also makes it update on live changes.

Thank you!

@MatzeMuc86
Copy link
Author

MatzeMuc86 commented Jan 7, 2025

I can confirm it is working now. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working main ui Main UI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants