Sliding broken when slide content is wrapped in anchor tag
See original GitHub issueWhen slide content is wrapped inside <a />
tag, sliding behaves weirdly; unusable on FF and Safari, Chrome deals with it somehow.
I believe this comes from here:
img
elements anda
elements with anhref
attribute have theirdraggable
attribute set to true by default.
Here’s the code I think is related to this, with the proposed solution:
export const swipeStart = (e, swipe, draggable) => {
e.target.tagName === "IMG" && e.preventDefault();
+ // my proposed solution
+ e.target.tagName === "A" && e.preventDefault();
if (!swipe || (!draggable && e.type.indexOf("mouse") !== -1)) return "";
return {
dragging: true,
touchObject: {
startX: e.touches ? e.touches[0].pageX : e.clientX,
startY: e.touches ? e.touches[0].pageY : e.clientY,
curX: e.touches ? e.touches[0].pageX : e.clientX,
curY: e.touches ? e.touches[0].pageY : e.clientY
}
};
};
What do you think?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:7
Top Results From Across the Web
Anchor tags not working in jquery slider - Stack Overflow
Each slide is wrapped in an anchor tag and is supposed to link to a post somewhere else on the site. However, the...
Read more >[Resolved] Issue with slides not linking to external link - Toolset
Solution: This can be done by wrapping the image in an anchor tag. <ul class="slides"> [wpv-for-each field="wpcf-flex-slider ...
Read more >Handling Long Words and URLs (Forcing Breaks ... - CSS-Tricks
Here's the scoop: overflow-wrap: break-word; makes sure the long string will wrap and not bust out of the container. You might as ...
Read more >Additional Text Content Options - Slider Revolution Manual
Use Toggle; Inverse Toggled Content. Add Line Break; Add Icon; Add Meta Data; Placeholder; Line Break; Text Align; HTML Tag; Convert Layer Type ......
Read more >Sliders | Themeco Docs
While the Inline Slider uses Flexbox to power its layout, the Stacked Slider uses a 1x1 CSS Grid layout with each Slide positioned...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
you can solve this problem if you adds the draggable attribute setted by false.
this is not stale, the problem still occurs