Project

General

Profile

Actions

Bug #9328

open

Strange XHTML ToolTip positioning

Added by Markus S over 2 years ago. Updated 5 months ago.

Status:
Review
Priority:
Normal
Assignee:
-
Target version:
Start date:
11/15/2021
Due date:
% Done:

0%

Estimated time:

Description

The vertical positioning of XHTML tooltips seems strange to me.

If there is not enough space to position its top to the cursor it positions its bottom to it, even if there is less space up.
(This does not happen in all situations, sometimes it trys to use all available height.)
In this situation the tooltip should use all available height and give up on positioning its top or bottom to the cursor.
If there is not enough space even if all the height is used it should enable vertical scrollbars.

See the attached gif of the example app.


Files

Wt_ToolTips.gif (926 KB) Wt_ToolTips.gif Markus S, 11/15/2021 01:57 PM
Example.cpp (1.45 KB) Example.cpp Markus S, 11/15/2021 02:02 PM
Actions #1

Updated by Korneel Dumon over 2 years ago

  • Status changed from New to InProgress
  • Assignee set to Korneel Dumon
  • Target version set to future

Hi,

like you said, sometimes it does use the full height. And I noticed that when it doesn't fit, a scrollbar shows up on the entire page. So if you keep your cursor on the tooltip the scrolling actually works.

Only question is why it is sometimes not working ... I will look into this further.

Actions #2

Updated by Markus S over 2 years ago

Korneel Dumon wrote in #note-1:

Hi,

like you said, sometimes it does use the full height. And I noticed that when it doesn't fit, a scrollbar shows up on the entire page. So if you keep your cursor on the tooltip the scrolling actually works.

Only question is why it is sometimes not working ... I will look into this further.

Okay, my example is not specific enough to the use case we have in our app.
In our app the page itself cant be resized like that to allow scrolling the tooltip like that.
I know such huge tooltips are rather crazy, but in our case it would be great if the tooltip itself could be scrolled if it does not fit.
With the browse development tools, I was able to manipulate the tooltip to scroll, but I did see no way customize this in the app.

If I remember correctly "fitToWindow" in Wt.js is used to place the tooltip, but like you said it now occured to me it must make the page scrollable.

If you like I can provide you with a better example, but maybe this does not fit this issue any more.

Actions #3

Updated by Korneel Dumon over 2 years ago

I was actually playing with an implementation to have the tooltip scroll rather than the page. Right now it is indeed fitToWindow that calculates the position of the tooltip, but I might change it so the tooltip is simply placed with a CSS position: fixed. This seems much more straigthforward. A consequence is that the page will no longer scroll, so if I go with this, the tooltip will have to become scrollable.

If you provide another example, I will be happy to use it during testing :)

Actions #4

Updated by Markus S over 2 years ago

Korneel Dumon wrote in #note-3:

I was actually playing with an implementation to have the tooltip scroll rather than the page. Right now it is indeed fitToWindow that calculates the position of the tooltip, but I might change it so the tooltip is simply placed with a CSS position: fixed. This seems much more straigthforward. A consequence is that the page will no longer scroll, so if I go with this, the tooltip will have to become scrollable.

If you provide another example, I will be happy to use it during testing :)

Sounds good!
I tried the initial example provided in this issue again, I cant get it to scroll. So it seems it shows our use case pretty good.
If you can get it to scroll without modifying the code, I dont know how you do it.

If I remove the WVBoxLayout and the SizeAwareContainer, and add the WPushButtons to the root() then I see the scrolling of the full page.

Actions #5

Updated by Roel Standaert over 2 years ago

  • Target version changed from future to 4.7.0
Actions #6

Updated by Korneel Dumon over 2 years ago

  • Status changed from InProgress to Review
  • Assignee deleted (Korneel Dumon)
Actions #7

Updated by Roel Standaert about 2 years ago

  • Target version changed from 4.7.0 to 4.8.0

Pushing this fix back since I didn't have the opportunity to properly review this yet.

Actions #8

Updated by Roel Standaert over 1 year ago

  • Target version changed from 4.8.0 to 4.9.0
Actions #9

Updated by Roel Standaert over 1 year ago

  • Target version changed from 4.9.0 to 4.10.0
Actions #10

Updated by Matthias Van Ceulebroeck 10 months ago

  • Target version changed from 4.10.0 to 4.10.1
Actions #11

Updated by Matthias Van Ceulebroeck 6 months ago

  • Target version changed from 4.10.1 to 4.10.2
Actions #12

Updated by Matthias Van Ceulebroeck 5 months ago

  • Target version changed from 4.10.2 to 4.10.3
Actions

Also available in: Atom PDF