File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
packages/core/ui/core/bindable Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,19 @@ export function getEventOrGestureName(name: string): string {
9393}
9494
9595export function isGesture ( eventOrGestureName : string ) : boolean {
96- return ! ! gestureFromString ( eventOrGestureName ) ;
96+ // I believe we perform a case-insensitive lookup rather than an exact match
97+ // for the original camelCase, mainly out of caution for upstream callers that
98+ // might have converted the event name to lowercase (which was certainly a
99+ // problem in Svelte 3).
100+ //
101+ // Not sure whether it's still needed in practice, though (all Core tests pass
102+ // without case-insensitive matching and without trimming whitespace), so
103+ // worth revisiting in future.
104+ const t = eventOrGestureName . trim ( ) . toLowerCase ( ) ;
105+
106+ // Would be nice to have a convenience function for getting all GestureState
107+ // names in `gestures-common.ts`, but it creates a circular dependency.
108+ return t === 'tap' || t === 'doubletap' || t === 'pinch' || t === 'pan' || t === 'swipe' || t === 'rotation' || t === 'longpress' || t === 'touch' ;
97109}
98110
99111// TODO: Make this instance function so that we dont need public statc tapEvent = "tap"
You can’t perform that action at this time.
0 commit comments