Skip to content

Commit 345981d

Browse files
Merge pull request #36 from godaddy/limit-prevent-default
Limit preventDefault calls in mousedown to only img elements
2 parents 0b621a2 + 52a6322 commit 345981d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,11 @@ export default class Carousel extends Component {
729729
onMouseDown(e) {
730730
const { draggable, transition } = this.props;
731731

732-
e.preventDefault();
732+
if (e.target.nodeName === 'IMG') {
733+
// Disable native browser select/drag for img elements
734+
e.preventDefault();
735+
}
736+
733737

734738
if (draggable && transition !== 'fade' && !this._animating) {
735739
if (this._autoplayTimer) {

0 commit comments

Comments
 (0)