fix(ios): TextField keyboard handling with emoji, autofill, and shortcuts (#10154)

closes https://github.com/NativeScript/NativeScript/issues/10108
This commit is contained in:
Nathan Walker
2023-01-03 17:36:56 -08:00
committed by GitHub
parent d138ac000d
commit 00944bb1b5
9 changed files with 50 additions and 4 deletions

View File

@@ -1,6 +1,7 @@
import * as types from './types';
import { dispatchToMainThread, dispatchToUIThread, isMainThread } from './mainthread-helper';
import { sanitizeModuleName } from '../ui/builder/module-name-sanitizer';
import emojiRegex from 'emoji-regex';
import { GC } from './index';
@@ -203,3 +204,9 @@ export function queueGC(delay = 900, useThrottle?: boolean) {
debouncedGC.get(delay)();
}
}
export function isEmoji(value: string): boolean {
// TODO: In a future runtime update, we can switch to using Unicode Property Escapes:
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions/Unicode_Property_Escapes
return emojiRegex().test(value);
}