Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃殌 - autodetect anchor element's scroll container #175

Open
3 of 9 tasks
navjotsingh96 opened this issue May 7, 2024 · 9 comments
Open
3 of 9 tasks

馃殌 - autodetect anchor element's scroll container #175

navjotsingh96 opened this issue May 7, 2024 · 9 comments
Labels
enhancement New feature or request

Comments

@navjotsingh96
Copy link

Which ngx-ui-tour-* package is the source of the bug?

md-menu

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/stackblitz-starters-9i9trv

Description

This problem is slimier to issue #152. If there is a scroll container and element scroll downs,
the correct position of the anchor element, mat-card and backdrop are not displayed.

If you click on previous button and go back to first element => again incorrect position of mat-card and backdrop

In #152 he had fixed somehow. but not said how.

Screenshot 2024-05-07 122302

Quick info: If you resized the window, everything is displayed correctly

Angular version

17.3.6

Ngx UI Tour version

12.0.3

Which browsers have you used?

  • Chrome
  • Firefox
  • Safari
  • Edge

Which operating systems have you used?

  • macOS
  • Windows
  • Linux
  • iOS
  • Android
@navjotsingh96 navjotsingh96 added bug Something isn't working needs-triage labels May 7, 2024
@hakimio
Copy link
Owner

hakimio commented May 7, 2024

The author had partially fixed #152 in PR #154.

@navjotsingh96
Copy link
Author

navjotsingh96 commented May 7, 2024

@hakimio Thanks for your reply.

Is the fix already included in the latest version or not? If yes, why is this the case?

If you disable backdrop, it is still wrong

@hakimio
Copy link
Owner

hakimio commented May 7, 2024

Check issue #138 to see if the same solution of setting scroll container config fixes your issue as well.

@navjotsingh96
Copy link
Author

unfortunately not

@hakimio
Copy link
Owner

hakimio commented May 7, 2024

Seems to be working after setting scrollContainer and making some minor CSS adjustments:
https://stackblitz.com/edit/stackblitz-starters-4jxxoc

@hakimio
Copy link
Owner

hakimio commented May 7, 2024

The tour needs to know the scroll container for the animated scroll to work. Otherwise you can disable the animated scrolling if you don't want to deal with setting the scroll container.

@hakimio hakimio added invalid This doesn't seem right and removed bug Something isn't working needs-triage labels May 7, 2024
@hakimio hakimio changed the title 馃悶 - wrong backdrop and anchor position 馃殌 - autodetect scroll container May 8, 2024
@hakimio hakimio added enhancement New feature or request and removed invalid This doesn't seem right labels May 8, 2024
@hakimio
Copy link
Owner

hakimio commented May 8, 2024

I thought about this a little bit more and I think it would be nice if the library could try to auto-detect anchor element's scroll container since it seems to be a common issue. If I have time, I'll take a look at this next week.

@hakimio hakimio changed the title 馃殌 - autodetect scroll container 馃殌 - autodetect anchor element's scroll container May 8, 2024
@navjotsingh96
Copy link
Author

Thanks for the help. It works now.

I thought about this a little bit more and I think it would be nice if the library could try to auto-detect anchor element's scroll container since it seems to be a common issue. If I have time, I'll take a look at this next week.

It would be better.

I think that a line under the scrollContainer section in the docs would be good, telling us how to first figure out scrollContainer and then bind it. As in my case, I thought that sidebar-content is scrollContainer, but it's mat-drawer-container.
So short introduction for now to reduce this kind of issues.

@hakimio
Copy link
Owner

hakimio commented May 8, 2024

If you have some good ideas how to improve the docs, feel free to open a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants