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

fix(pw): drag n drop issue #3692

Merged
merged 5 commits into from
Jun 30, 2023
Merged

fix(pw): drag n drop issue #3692

merged 5 commits into from
Jun 30, 2023

Conversation

kobenguyent
Copy link
Collaborator

Motivation/Description of the PR

  • Drag and drop doesn't work with Angular and React webapp

Applicable helpers:

  • Playwright

Type of change

  • 🐛 Bug fix

Checklist:

  • Tests have been added
  • Documentation has been added (Run npm run docs)
  • Lint checking (Run npm run lint)
  • Local tests are passed (Run npm test)

@EgorBodnar
Copy link
Contributor

It's a Playwright issue in the feature implementation: microsoft/playwright#1094

We need to study the problem in more detail. Please don't merge it yet 🙏

async dragAndDrop(srcElement, destElement, options = { force: true }) {
const src = new Locator(srcElement, 'css');
const dst = new Locator(destElement, 'css');
async dragAndDrop(srcElement, destElement) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand well, it would break my use case because you removed the options parameter:

    // Move the object from default to initial position
    I.dragAndDrop(konvajsFragment.gameArea, konvajsFragment.gameArea, {
        sourcePosition: OBJECT_DEFAULT_POSITION,
        targetPosition: OBJECT_INITIAL_POSITION,
    });

Copy link
Collaborator Author

@kobenguyent kobenguyent Jun 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with the new implementation, I don't feel like we need the options parameter.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kobenguyent
My use case is "Move an object from one position to another one inside an area (canvas)". Therefore I need to pass source and target coordinates to I.dragAndDrop().

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @mirao @EgorBodnar fixing for backward compatibility.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @mirao @EgorBodnar fixing for backward compatibility.

great! Looks good

An additional flag would be more intuitive for users, but your solution is more elegant.

@kobenguyent kobenguyent merged commit cf714ec into 3.x Jun 30, 2023
@kobenguyent kobenguyent deleted the fix-pw-dragNDrop branch June 30, 2023 04:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants