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

improve detection when dragged element is a link #167

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/siema.js
Original file line number Diff line number Diff line change
@@ -533,9 +533,15 @@ export default class Siema {
// if dragged element is a link
// mark preventClick prop as a true
// to detemine about browser redirection later on
if (e.target.nodeName === 'A') {
this.drag.preventClick = true;
}

let target = e.target
do {
if (target.nodeName === 'A') {
Copy link
Contributor

Choose a reason for hiding this comment

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

I've suggest to use nodeName.toLowerCase() and compare with a. You never know what case will be returns (IE eg)

Copy link
Owner

Choose a reason for hiding this comment

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

Good point :) I promise to come here and merge all relevant PRs. One day. To be honest I do not care about Siema that much anymore...

https://twitter.com/pawelgrzybek/status/1045199798838669312

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe I can be a maintainer? SIEMA is so awesome for me 😄

Copy link
Owner

Choose a reason for hiding this comment

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

Can we do a Skype chat one day or catch up in Warsaw about it? Short answer - yes :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes!

Choose a reason for hiding this comment

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

UX issues aside, was there an update on this? Unfortunately, some of us still end up having to build carousels!

Choose a reason for hiding this comment

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

How can i edit siema.js from src, and be able to use it?

The unminified siema doesnt work, only min.js

So i cant use your changes, and i really need to try that

I want to compile a new siema with your modification, im using v1.51 but have the link-open-bug when sliding link content

this.drag.preventClick = true;
break
}
target = target.parentNode
} while (target != null)

this.drag.endX = e.pageX;
this.selector.style.cursor = '-webkit-grabbing';