mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-15 17:42:15 +08:00
chore(): sync with main
This commit is contained in:
@ -62,6 +62,17 @@ export const getClassName = (classList: DOMTokenList, newProps: any, oldProps: a
|
||||
return finalClassNames.join(' ');
|
||||
};
|
||||
|
||||
/**
|
||||
* Transforms a React event name to a browser event name.
|
||||
*/
|
||||
export const transformReactEventName = (eventNameSuffix: string) => {
|
||||
switch (eventNameSuffix) {
|
||||
case 'doubleclick':
|
||||
return 'dblclick';
|
||||
}
|
||||
return eventNameSuffix;
|
||||
};
|
||||
|
||||
/**
|
||||
* Checks if an event is supported in the current execution environment.
|
||||
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
||||
@ -70,7 +81,7 @@ export const isCoveredByReact = (eventNameSuffix: string) => {
|
||||
if (typeof document === 'undefined') {
|
||||
return true;
|
||||
} else {
|
||||
const eventName = 'on' + eventNameSuffix;
|
||||
const eventName = 'on' + transformReactEventName(eventNameSuffix);
|
||||
let isSupported = eventName in document;
|
||||
|
||||
if (!isSupported) {
|
||||
|
Reference in New Issue
Block a user