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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[atable] ATableModal does not attach to cell when scrolling #214

Closed
agritheory opened this issue Dec 6, 2024 · 3 comments · Fixed by #220
Closed

[atable] ATableModal does not attach to cell when scrolling #214

agritheory opened this issue Dec 6, 2024 · 3 comments · Fixed by #220

Comments

@agritheory
Copy link
Owner

image

@agritheory
Copy link
Owner Author

The cell with the 7/3/20 date is the one that this is attached to

@agritheory agritheory changed the title ATableModal does not attach to cell when scrolling [atable] ATableModal does not attach to cell when scrolling Dec 6, 2024
@agritheory agritheory assigned crabinak and unassigned crabinak Dec 9, 2024
@agritheory
Copy link
Owner Author

@Alchez Talked this over with Curt and the proposed solution is update the modal's position detecting scroll (and page up/down) This should also work for horizontal scroll contexts.

@Alchez
Copy link
Collaborator

Alchez commented Dec 10, 2024

@agritheory @crabinak

Okay, here's what I've tested so far and the corresponding results:

  • VueUse's useWindowScroll composable:
    • I could only get this to match the expected results in very specific circumstances, considering that:
      • I was running the tests within the Histoire context, which might be interfering with the scroll values?
      • useWindowScroll returns absolute scroll values, and not relative (but we could probably consider using some additional logic to find a relative value)
    • Vertical scrolling would lock the modal component, but only if it was spawned from the top of the table (no scrolling has occurred), whereas for cells near the end of the modal would spawn with an offset equal to the distance scrolled.
    • Horizontal scrolling didn't seem to work at all, but I'm not sure if that's because of the Histoire rendering or something wrong in the composable.
  • VueUse's useScroll composable/component:
    • I tried applying this to a bunch of targets (window, modal, etc.) but I'm not sure what's a good target for this composable/component, cause none of them worked for me.
  • Native scroll event listener:
    • I also tried using the native scroll event listener directly in Vue (@scroll) but that had the same result as useScroll above, which makes sense because useScroll uses the scroll event listener, and makes me think this might be a target issue most likely.

What should the target be? Should we be listening to the whole window? Or a different context?

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

Successfully merging a pull request may close this issue.

3 participants