How to prevent unnecessary scroll bars in dialog box?
I created a splash screen for my VertiGIS Studio Web app using a dialog component as described in this documentation, as opposed to using the built-in splash screen capability (because I wanted the screen to persist until the user is ready to dismiss it).
It works great, except that the dialog box has scroll bars, unnecessarily - the text all fits in the box, and there's a huge amount of real estate on the screen, such that the box could be about five times bigger if needed. Even though the text fits just fine, there are these scroll bars, and I just hate how it looks.

Does anyone know of a way of changing the behavior so it doesn't have scroll bars unnecessarily?
Thank you.
-
I wonder how you got that left scroll bar there, could you share how the display form is configured?
As for the right scroll bar, you could use an Inject CSS activity with the following content.
div[data-layout-id="workflow-cd888a44"] { overflow-y: hidden !important; }Replace workflow-cd888a4 with the actual ID that you can copy from the Web designer by opening the workflow component, and clicking on the cog icon.
0 -
Thank you for your help!!
Your method worked to get rid of the longer scroll bar, but not the shorter one that's next to the app title in my dialog box. So, thanks for getting me that far! Maybe I can include an additional Inject CSS line for the remaining scroll bar…
Regarding my configuration, the app title text is a “text” element, and the informational blurb is another “text” element. The scroll bar appearance makes it look like they are somehow nested, but I don't believe they are. They both have “Title Location” as “above”; that's really the only configuration.
0 -
Update - I managed to also get rid of the second scroll bar by adding a copy of your suggested Inject CSS code, so that altogether I have one for the workflow, as you suggested, and another for the text box containing the app name. For the latter, I used not the data layout ID but the ID of that text box, which I found using the browser developer tools ("Inspect").
So that solves the problem!
However, if someone viewed the app on a small screen like a phone, the text gets cut off and they have no way of scrolling.
I was already beginning to consider having my splash screen content in the app's Home panel instead, so users wouldn't have to click on the splash screen every time they open the app. This scroll bar issue (the problem of either having scroll bars all the time, or not at all, even when they're needed) is making me lean even more towards putting the content in the Home panel instead of a splash screen. But I'm so glad you helped me figure it out, Berend Veldkamp , since I'm sure this will be helpful to me somehow with future apps.
0 -
I don't think scrollbars are really needed on touch devices, but if you want, you can always inject the CSS conditionally, based on
window.screen.width, and only hide scrollbars above a certain threshold. Possibly multiplied withwindow.devicePixelRatiofor HD displaysBTW, the unnecessary scrollbars may be a bug in the Viewer framework, so you could also submit a request to VertiGIS about this.
0 -
It just occurred to me, rather than a workflow, you could also simply add a Text component and a button to the dialog, maybe that also solves the scrollbar problem. And it saves you a workflow ;-)

Set the button's command to (change the dialog id):
[ { "name": "ui.deactivate", "arguments": "dialog-d7cf91e2" } ]And the Text to something like this:
# Title body text0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
5 kommentarer