Skip to content

[FR] Disable vertical scrolling?" #328

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

Closed
Jaxel opened this issue Jan 1, 2025 · 28 comments
Closed

[FR] Disable vertical scrolling?" #328

Jaxel opened this issue Jan 1, 2025 · 28 comments
Labels
invalid This doesn't seem right

Comments

@Jaxel
Copy link

Jaxel commented Jan 1, 2025

Can we get an option to disable scrolling on a dashboard?

@elchininet
Copy link
Collaborator

Hi @Jaxel,
What would be the use case of that request? Is it not enough to avoid putting too many elements in that dashboard to avoid the vertical scrolling?
Regards

@Jaxel
Copy link
Author

Jaxel commented Jan 2, 2025

It's hard to explain in text what's happening here, so I made some videos:

PXL_20250101_155124725-ezgif com-video-to-gif-converter

And here is a longer video explaining the exact HTML/CSS issue:
https://www.youtube.com/watch?v=xzJ2rAnEv08

@elchininet
Copy link
Collaborator

It's hard to explain in text what's happening here, so I made some videos:
And here is a longer video explaining the exact HTML/CSS issue:
https://www.youtube.com/watch?v=xzJ2rAnEv08

Thanks @Jaxel, it is clear now.
That falls out of the scope of the plugin. Instead of trying to add an option to resolve your specific use case, let's try to triage from which place is your issue coming. I cannot reproduce it in the Docker demo, so I suspect that it is coming from your theme or something that you have set up. Let's try to rule out things, are you using a theme or you are using the default Home Assistant theme?

@Jaxel
Copy link
Author

Jaxel commented Jan 2, 2025

Default theme. Only happens when Kiosk mode is enabled.

@elchininet
Copy link
Collaborator

Default theme.

Perfect, let's keep ruling out things, could you tell me which layout you are using?

Only happens when Kiosk mode is enabled.

It makes sense, because in kiosk-mode there is no header 🙂

But as the Docker demo is a Home Assistant instance without anything else installed but kiosk-mode it is the perfect place to reproduce things. If it is not happening there by default, then the way to go is to try to reproduce your set up to detect what is causing the issue.

@Jaxel
Copy link
Author

Jaxel commented Jan 2, 2025

It also only happens on my Samsung A9+ tablets. Doesn't happen on my cell phone.

@elchininet
Copy link
Collaborator

It also only happens on my Samsung A9+ tablets

I have a Galaxy Tab A8 so maybe I can reproduce it there, let me know which layout you are using to build something similar to yours.

@Jaxel
Copy link
Author

Jaxel commented Jan 2, 2025

It's a YAML layout.

@Jaxel
Copy link
Author

Jaxel commented Jan 2, 2025

I have HACS with card-mod, Spook, and Paper Buttons Row installed. That's it.

@elchininet
Copy link
Collaborator

It's a YAML layout.

I don't mean that. In a dashboard, each view can have a layout (Sections, Masonry, etc). Looking at your screen it could be a Masonry one but I am not sure.

@Jaxel
Copy link
Author

Jaxel commented Jan 2, 2025

YAML layouts are masonry.

@elchininet
Copy link
Collaborator

elchininet commented Jan 2, 2025

YAML layouts are masonry.

I think that you don't get what I am asking, this is one of the dashboards in the Docker demo, all the dashboards are written in YAML:

kiosk_mode:
  hide_header: true
title: Kiosk-mode hide header
views:
  - theme: Backend-selected
    title: Hide Header
    path: kiosk-mode-hide-header
    badges: []
    cards:
      - type: markdown
        content: This dashboard has the setting `hide_header` on `true`.

But I can set up the layout in the view if I want:

kiosk_mode:
  hide_header: true
title: Kiosk-mode hide header
views:
  - theme: Backend-selected
    title: Hide Header
    path: kiosk-mode-hide-header
    badges: []
    cards:
      - type: markdown
        content: This dashboard has the setting `hide_header` on `true`.
    type: xxx ## <--- here is set up the layout (e.g. sections)

Let me know if you are using any layout.

@Jaxel
Copy link
Author

Jaxel commented Jan 2, 2025

kiosk_mode:
  kiosk: true

views:
  - title: Overview
    path: overview
    cards:
      - !include overview-column-1.yaml
      - !include overview-column-2.yaml
      - !include overview-column-3.yaml

YAML layouts are Masonry by default.

@elchininet
Copy link
Collaborator

YAML layouts are Masonry by default.

There are no such thing as "YAML layouts" 🙂

I think that you mean that you use YAML mode instead of storage mode, but that doesn't define the layout of a view. Looking at your code you don't have any layout set up, so it is Masonry in that case as in the docker demo. Could you post the code of the view in which you have your cameras? In that way I can set up a similar one in the docker demo.

@Jaxel
Copy link
Author

Jaxel commented Jan 2, 2025

kiosk_mode:
  kiosk: true

views:
  - title: Cameras
    path: cameras
    theme: cameras
    cards:
      - !include cameras-column-1.yaml
      - !include cameras-column-2.yaml
      - !include cameras-column-3.yaml

cameras-column-1.yaml

type: vertical-stack
cards:
  - type: heading
  - type: heading
  - type: heading
  - type: heading
  - type: heading
  - type: heading
  - type: heading
  - type: heading
  - type: heading
  - type: heading
    
  - type: picture-entity
    entity: camera.door_bell_porch
    camera_image: camera.door_bell_porch
    camera_view: live
    aspect_ratio: "3:4"
    show_state: false
    show_name: false
    tap_action: none

cameras-column-2.yaml

type: vertical-stack
cards:
  - type: heading
  - type: heading
  - type: heading
  - type: heading
  - type: heading
  - type: heading
  - type: heading
  - type: heading
  - type: heading
  - type: heading
    
  - type: heading
    icon: mdi:home-outline
    heading: Camera @Driveway
    
  - type: picture-entity
    entity: camera.camera_driveway
    camera_image: camera.camera_driveway
    camera_view: live
    aspect_ratio: "16:9"
    show_state: false
    show_name: false
    tap_action: none
    
  - type: picture-entity
    entity: camera.camera_garage
    camera_image: camera.camera_garage
    camera_view: live
    aspect_ratio: "16:9"
    show_state: false
    show_name: false
    tap_action: none
    
  - type: heading
    icon: mdi:car-outline
    heading: Camera @Garage

cameras-column-3.yaml

cards:
  - type: heading
  - type: heading
  - type: heading
  - type: heading
  - type: heading
  - type: heading
  - type: heading
  - type: heading
  - type: heading
  - type: heading
    
  - type: heading
    icon: mdi:pool
    heading: Camera @Patio
    
  - type: picture-entity
    entity: camera.camera_patio
    camera_image: camera.camera_patio
    camera_view: live
    aspect_ratio: "16:9"
    show_state: false
    show_name: false
    tap_action: none
    
  - type: picture-entity
    entity: camera.camera_living_room
    camera_image: camera.camera_living_room
    camera_view: live
    aspect_ratio: "16:9"
    show_state: false
    show_name: false
    tap_action: none
    
  - type: heading
    icon: mdi:theater
    heading: Camera @Living Room

@elchininet
Copy link
Collaborator

Perfect, let me try to set up something similar.

@elchininet
Copy link
Collaborator

I cannot reproduce it, either in the browser or in my Galaxy Tab A8 🙁

Could you open that view in your browser and let me know if it occurs there?

kiosk-mode.mp4

@Jaxel
Copy link
Author

Jaxel commented Jan 2, 2025

Upon further testing, I can confirm it only happens when using the Home Assistant Companion app in FULL SCREEN mode... The reason it doesn't happen on my cell phone is that I don't use it in full screen mode there.

@elchininet
Copy link
Collaborator

Upon further testing, I can confirm it only happens when using the Home Assistant Companion app in FULL SCREEN mode... The reason it doesn't happen on my cell phone is that I don't use it in full screen mode there.

Oh, that is a good finding. I'll try to simulate it and I will try to check if something can be done to avoid that behavior. I'll update you with anything that I find.

@Jaxel
Copy link
Author

Jaxel commented Jan 2, 2025

More testing. I installed the Fully Kiosk Browser APK. Same exact issue with full screen mode.

@elchininet
Copy link
Collaborator

More testing. I installed the Fully Kiosk Browser APK. Same exact issue with full screen mode.

Weird, that is the APK that I am using in my tablet. I will check with full-screen mode first, I'll let you know.

@elchininet
Copy link
Collaborator

Hi @Jaxel,

No success trying to reproduce it. Let's do the things different because maybe it is something coming from the device and that is why I cannot reproduce it. Follow the next steps in your device:

  1. Go to Settings > Companion App > Debug > WebView Remote Debug and activate it
  2. Use Chrome Remote Debugging to connect to your device: https://developer.chrome.com/docs/devtools/remote-debugging
  3. Open chrome://inspect/#devices
  4. Inspect the WebView relative to Home Assistant
  5. First of all, in Application > Storage, uncheck Local and Session Storage and Cookies and click on Clear Site Data. In this way, we ensure that you are using the latest kiosk-mode version and not a version in cache.
  6. Then, on your computer in the debug tools try to locate the hui-view-container element and check the styles of that element to see if the style for the height is there or it is overridden by some other styles
  7. If that style is OK just dig around among all the elements to see if you can identify what is adding that height

image

@Jaxel
Copy link
Author

Jaxel commented Jan 2, 2025

That helped me figure out what was causing the scroll... It's the HACS card Paper Buttons Row.

<paper-buttons-row-action-handler style="position: absolute; width: 100px; height: 100px; transform: translate(-50%, -50%); pointer-events: none; z-index: 999;"><mwc-ripple></mwc-ripple></paper-buttons-row-action-handler>

This element is placed at the bottom left of the page in an absolute position BEFORE the header is removed by Kiosk Mode.

@Jaxel
Copy link
Author

Jaxel commented Jan 2, 2025

This issue appears to have been reported on the Paper Buttons Row github:
jcwillox/lovelace-paper-buttons-row#125
jcwillox/lovelace-paper-buttons-row#196

@elchininet
Copy link
Collaborator

This element is placed at the bottom left of the page in an absolute position BEFORE the header is removed by Kiosk Mode.

That is why I could not reproduce it, I don't have Paper Buttons Row installed. Do you know what is the function of that element in Paper Buttons Row? You can try to move it to another place using card-mod.

@Jaxel
Copy link
Author

Jaxel commented Jan 2, 2025

I just edited the JS and applied a display: none to the element and all is fixed.

@elchininet
Copy link
Collaborator

I just edited the JS and applied a display: none to the element and all is fixed.

Well, that is also a quick fix, the only drawback is that it will go away if you update the plugin. :)

Anyway, glad that it is already solved.

@elchininet
Copy link
Collaborator

Hi @Jaxel,
Closing this one.
Regards

@elchininet elchininet added invalid This doesn't seem right and removed ✨ feature-request labels Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants