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

Selection Bound Area is positioned away from the modal #127

Open
quankhuc opened this issue Apr 19, 2023 · 3 comments
Open

Selection Bound Area is positioned away from the modal #127

quankhuc opened this issue Apr 19, 2023 · 3 comments
Labels
question Further information is requested

Comments

@quankhuc
Copy link

Environments

  • Framework name: Nuxt.JS
  • Framework version: Nuxt 3
  • Component name: vue3-selecto
  • Component version: 1.8.2
  • Testable Address(optional):

Description

Hi, I am trying to incorporate your package into a dialog (modal). For the dialog (modal), I used headless-ui dialog component to make this modal. When I attempted to put boxes into a selection area by using your package example code, the selection bound is no longer attached within the selection area. It instead deviates by the value of clientX of the MouseEvent. I attached a video that captures the issue.

Screen.Recording.2023-04-19.at.1.53.57.AM.mov

As you can see in the video, when I tried to click on the top left of the white bordered selection area, the clientX is about 300px. The selection bound area (blue area)is off in the horizontal direction by about the same amount of pixels. The same behavior can be seen with vertical direction.

Here is the link to my dialog code:

https://github.com/quankhuc/nuxt-catoptric-project/blob/main/components/Dashboard/PanelModal.vue

I appreciate any guidances or future fixes on this issue.

@daybrush daybrush added the question Further information is requested label Apr 19, 2023
@daybrush
Copy link
Owner

@quankhuc

I think there is a possibility that the transform is applied to the container containing the selecto.

If so, put the selecto on the parent element to which no transform is applied, or set rootContainer={document.body} or the parent element.

@quankhuc
Copy link
Author

quankhuc commented Apr 20, 2023

It worked when I brought it to dashboard component, which is the parent component of this modal. I tried to bring the selecto to the component and keep my modal code in a child component, but it did not work because it seemed that the selecto cannot read classes that are not present at its present component. Are there any ways I can have the selecto on a child component? For example, could you provide an example that you use the selecto in a child component ?

@quankhuc
Copy link
Author

I got it to work in a children component by havign the selecto outside of my latest TransitionChild. It is all under the PanelModal component now. Thank you for your helps and your work on the package. I really appreicated it

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

No branches or pull requests

2 participants