Possible to have a scrollbar in a webdialog?

Hi folks,

I have some webdialogs inside some webpages.
is it possible with some simple javascript to add a scrollbar to an existing webdialog ?
so that if the user has a screen too small he has a scrollbar to be able to edit the fields at the
bottom of the dialog ?
or do I have to make the dialog again using some webcontainer and embedding all the webcontrols ?

thanks.

You can add a taller WebContainer inside a WebDialog. Then, in that container, set the Scroll Direction to “Vertical”:

I think Jean-Yves wants something like the Bootstrap - Scrolling Long Content - .modal-dialog-scrollable

screencast2024-03-2710-48-25-ezgif.com-video-to-gif-converter

I will try to put all the webcontrols inside a webcontainer, and then only the webcontainer in the webdialog
with the scroll set to vertical. could it work like that ?
I would prefer to simply have some javascript to add to the webdialog, and have auto scroll horiz and vertical happen …?

I will still have to adjust the width and height of the webdialog to the size of the user screen, when I open the webdialog…

Here is the code for adding the modal-dialog-scrollable CSS class. It can be pasted in the WebDialog.Opening event:

Me.ExecuteJavaScript("document.querySelector('#" + Self.ControlID + " .modal-dialog').classList.add('modal-dialog-scrollable');")
2 Likes

Does your WebDialog change size vertically if shown on a smaller screen?
If not, the web page should show a vertical scrollbar like this:

one problem I see with my test is that the width does not show a scrollbar:
screencast2024-03-2711-09-16-ezgif.com-video-to-gif-converter

sorry this does’nt seems to make any scrollbar appear in my webdialogs …

It works here:

Are your dialogs standard Xojo web dialogs or a subclass/WebSDK created by you?

they are subclasses of xojo webdialog
I pasted ricardo’s code in the opening event, and called the next opening in the subclasses
but it does nothing.
I will check deeper …