Skip to content

Move non-draggable implementation of carousel-items images, from js to css#35107

Closed
GeoSot wants to merge 1 commit intomainfrom
gs/simpify-carousel-non-draggable-images
Closed

Move non-draggable implementation of carousel-items images, from js to css#35107
GeoSot wants to merge 1 commit intomainfrom
gs/simpify-carousel-non-draggable-images

Conversation

@GeoSot
Copy link
Member

@GeoSot GeoSot commented Oct 4, 2021

With out knowing the exact reason of dragging prevent default, being there, I suppose is more efficient to handle it using some simple css to achive the same result

Could also be pointer-events: none, but I am not sure if it will cause an accessibility issue

@GeoSot GeoSot force-pushed the gs/simpify-carousel-non-draggable-images branch from 4625603 to 9b1d802 Compare October 4, 2021 23:10
@GeoSot GeoSot force-pushed the gs/simpify-carousel-non-draggable-images branch from 9b1d802 to 4a1c8f6 Compare October 5, 2021 23:17
@XhmikosR
Copy link
Member

XhmikosR commented Oct 7, 2021

@mdo @patrickhlauke do you know if it's pointer-events: none or user-select: none or both?

@patrickhlauke
Copy link
Member

patrickhlauke commented Oct 23, 2021

user-select: none won't prevent images from being dragged (at least not in Chrome where I just tested it). pointer-events: none makes the whole image "transparent" to any mouse interactions, but i'd be very careful with that as it also stops legitimate things like being able to right-click to save an image etc.

long story short: I'd leave this as is and keep using JS

(and note that in our docs, we don't use actual <img> elements but <svg>, so won't be able to directly test this ... and the extra styles for docs do have user-select: none for those svgs to prevent the <text> inside them from being selectable, but that's a completely separate issue to images)

@XhmikosR XhmikosR closed this Oct 24, 2021
@XhmikosR XhmikosR deleted the gs/simpify-carousel-non-draggable-images branch October 24, 2021 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants