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

Unexpected behavior of the ConfirmDialog component during dragging process #4251

Closed
Dmytro-Lukashenko opened this issue Aug 9, 2023 · 0 comments · Fixed by #4252
Closed
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@Dmytro-Lukashenko
Copy link
Contributor

Dmytro-Lukashenko commented Aug 9, 2023

Describe the bug

If the user adds a margin to the component (<ConfirmDialog class="mx-4"/>), the ConfirmDialog component will have unexpected behavior during the dragging process. When the user tries to drag the popup to the left, it moves to the right. The reason for this bug is inside the logic of the calculation coordinates of the popup during the dragging process. We can solve this problem by subtracting the margin-left from leftPos and margin-top from topPos when we calculate this.container.style.left and this.container.style.top.

This issue linked to the fixes for PrimeNg and PrimeReact

Reproducer

https://stackblitz.com/edit/kex6xr?file=src%2FApp.vue

PrimeVue version

3.30.2

Vue version

3.x

Language

ES6

Build / Runtime

Vite

Browser(s)

Chrome

Steps to reproduce the behavior

1.. Create a new Vue component and add the ConfirmDialog component to the template.
2. Add a button to the template to trigger the popup appearing.
2. Add class "mx-4" to the ConfirmDialog component.
3. Click the button to popup appears.
4. After the popup appears try to drag it to the left.
5. The popup moves to the right.

unexpected_behavior.webm

Expected behavior

If you drag the popup, it should move in the direction of dragging regardless of the margins of this popup.

expected_behavior.webm
@Dmytro-Lukashenko Dmytro-Lukashenko added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Aug 9, 2023
@mertsincan mertsincan added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Aug 15, 2023
@mertsincan mertsincan added this to the 3.32.1 milestone Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants