From 5ceb45d065ae2be540f80d35b392a265d3a2e8d7 Mon Sep 17 00:00:00 2001 From: Clauderic Demers Date: Mon, 5 Sep 2016 14:32:47 -0400 Subject: [PATCH] Added comments to default `shouldCancelStart` implementation --- src/SortableContainer/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/SortableContainer/index.js b/src/SortableContainer/index.js index f0b428183..57cb7907d 100644 --- a/src/SortableContainer/index.js +++ b/src/SortableContainer/index.js @@ -32,8 +32,9 @@ export default function SortableContainer(WrappedComponent, config = {withRef: f hideSortableGhost: true, contentWindow: typeof window !== 'undefined' ? window : null, shouldCancelStart: function (e) { + // Cancel sorting if the event target is an `input`, `textarea`, `select` or `option` if (['input', 'textarea', 'select', 'option'].indexOf(e.target.tagName.toLowerCase()) !== -1) { - return true; + return true; // Return true to cancel sorting } }, lockToContainerEdges: false,