jon48 / webtrees-theme-rural

Rural theme for webtrees
GNU General Public License v3.0
11 stars 2 forks source link

display moves to left border #58

Open arbor95 opened 1 year ago

arbor95 commented 1 year ago

on getting the bubble info for a birth the view moves left. Just tested minimal theme and webtrees theme: the same but Justlight, Colors and argon themes show ok (cause they are already left) See:

ok

afterClick

jon48 commented 1 year ago

I am somehow glad that you are reporting this issue, as this is something I have occasionnally been experiencing when developing, but I have always “blamed” a browser or local issue.

Unfortunately, whereas I fully acknowledge the issue, my difficulty is that I have never been able to find a reproducible scenario for it, which makes the troubleshooting very difficult. It usually disappears as mysteriously as it comes, and restarting the browser has always been my go-to solution. When it happens, the Developer Tools has never been able to give me a clue.

Are you able to provide a scenario that can be reproduced, or is it as random as I have observed? If you can reproduce, that will give me a chance to investigate.

arbor95 commented 1 year ago

the move is always when I click on one of the icons (that show a popup) (birth, death, marriage,..).

arbor95 commented 1 year ago

I have just noticed a move that seems to be arbitrary but is not. The reason is trying to center the map. wt tries to center the map and rises the bubble (popup) on clicking on a person on the right side (list of ancestors). If a clicked ancestor has another location than the previous one selected, this may force the unwanted move. (meaning not only the map moves, but also the complete screen.)

jon48 commented 1 year ago

I am not sure it is exactly the same issue I experience in development, but there is clearly an issue. I can indeed easily reproduce it when opening the pop up on any map.

I have managed to pinpoint what is causing the issue. This is the scrollIntoView call in the maps that triggers the shift, for instance in the Pedigree hierarchy page.

I am not familiar with that function, but it is necessary in order to "scroll" to the corresponding location on the right pane (which is scrollable when the list of location is too long). This is a native Javascript function, but I have not found out yet how it is interfering with the overall layout: in its documentation, it is clearly going up beyond the element to be able to display it, so it is not entirely surprising it may be messing up with the display, but I still need to understand how, so that I can maybe tweak some CSS to prevent it.

ddrury commented 1 year ago

@jon48, I wrote the code that uses this function and I initially had the same problem and had to change the option block: start to block: nearest it may be worth playing some more, see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView

Dave

arbor95 commented 1 year ago

will hopefullly be solved, when https://github.com/jon48/webtrees-theme-rural/issues/62 is solved

jon48 commented 1 year ago

Unfortunately, there is nothing new in 2.1.17 addressing this area, so I am keeping it open, for further investigations when I will find some time.

arbor95 commented 1 year ago

Ok, the effekt is still there with the 2.1.17-v1 version of your theme, as you expected (thanks for the update). (sorry for closing)