Project

General

Profile

Actions

Bug #9689

open

Auth::RegisterWidget not usable on Mobile

Added by Christian Meyer over 3 years ago. Updated 13 days ago.

Status:
New
Priority:
High
Assignee:
-
Target version:
Start date:
01/31/2022
Due date:
% Done:

0%

Estimated time:
0:06 h

Description

Hello

The Standard Registration Widget is not usable on a Mobile Browser, as it gets too big to find/press the Buttons below.

These Issues trace back almost 9 Years and with the current situation of 50% Mobile use, this should be addressed!

Also it is quite easy to fix: (at least for relatively modern browsers since 2016)

// add to Constructor of WDialog
  setMaximumSize(WLength(90, LengthUnit::ViewportWidth), WLength(90, LengthUnit::ViewportHeight));
  contents_->setOverflow(Wt::Overflow::Scroll, Wt::Orientation::Vertical);

This helps with both the Size of any WDialog and all contents within.
This should also not interfere with the IE6 hacks...

Also with a current Marketshare of 0.01% as of December 2021, IE6 should no longer be supported at all...
source: Wikipedia: https://en.wikipedia.org/wiki/Internet_Explorer_6#Market_share

These other issues are also related to sizing problems and will likely be solved with this change.

https://redmine.webtoolkit.eu/issues/5766
https://redmine.webtoolkit.eu/issues/1414
https://redmine.webtoolkit.eu/issues/3932
https://redmine.webtoolkit.eu/issues/5765

https://redmine.webtoolkit.eu/boards/2/topics/13341
https://redmine.webtoolkit.eu/boards/2/topics/12036
https://redmine.webtoolkit.eu/boards/2/topics/11888

Actions #1

Updated by Roel Standaert over 3 years ago

  • Target version set to future

We're not really supporting IE 6, we just didn't actively remove that code.

Doing dialogs differently on mobile is something we can consider.

Actions #2

Updated by Christian Meyer almost 3 years ago

There might not be a need to do things differently on mobile!
Just setting a reasonable max-size will do, especially for the built-in Registration Widget!

  // add to WDialog::create() at ~line 320
  setMaximumSize(WLength(90, LengthUnit::ViewportWidth), WLength(90, LengthUnit::ViewportHeight));
  contents_->setOverflow(Wt::Overflow::Auto, Wt::Orientation::Vertical);

If you wouldn't mind explaining how this solution would not work or be undesireable?
I'd appreciate it =)
Thanks

Actions #3

Updated by Christian Meyer 13 days ago

Just read in Bootstrap Documentation:

You can also create a scrollable modal that allows scrolling the modal body by adding .modal-dialog-scrollable to .modal-dialog.

<!-- Scrollable modal BS 5.3 -->
<div class="modal-dialog modal-dialog-scrollable">
  ...
</div>

With that alone, the problem is solved =)

https://getbootstrap.com/docs/5.3/components/modal/
https://getbootstrap.com/docs/5.2/components/modal/

I updated Bootstrap5Theme:

  case DomElementType::DIV: {
    auto dialog = dynamic_cast<WDialog *>(widget);
    if (dialog) {
      element.addPropertyWord(Property::Class, "modal modal-dialog modal-dialog-centered modal-dialog-scrollable Wt-dialog");
      return;
    }

and these styles need to be deactivated:

.Wt-dialog.modal {
  display: block;
  height: auto;
  width: auto;
}

which I did not look into for this small test. I just deactivated it in the browser console for testing

Registration Widget is now scrolling on mobile and therefore usable!

This way is also more portable than setting the maxSize in code, which was a terrible Idea.

Actions

Also available in: Atom PDF