@expensify/react-native-live-markdown 0.1.79 → 0.1.81

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,6 +16,7 @@ import {StyleSheet} from 'react-native';
16
16
  import * as ParseUtils from './web/parserUtils';
17
17
  import * as CursorUtils from './web/cursorUtils';
18
18
  import * as StyleUtils from './styleUtils';
19
+ import * as BrowserUtils from './web/browserUtils';
19
20
  import type * as MarkdownTextInputDecoratorViewNativeComponent from './MarkdownTextInputDecoratorViewNativeComponent';
20
21
  import './web/MarkdownTextInput.css';
21
22
  import InputHistory from './web/InputHistory';
@@ -336,8 +337,7 @@ const MarkdownTextInput = React.forwardRef<TextInput, MarkdownTextInputProps>(
336
337
  return;
337
338
  }
338
339
  const changedText = e.target.innerText;
339
-
340
- if (compositionRef.current) {
340
+ if (compositionRef.current && !BrowserUtils.isMobile) {
341
341
  updateTextColor(divRef.current, changedText);
342
342
  compositionRef.current = false;
343
343
  return;
@@ -1,4 +1,11 @@
1
1
  const isFirefox = navigator.userAgent.toLowerCase().includes('firefox');
2
2
  const isChromium = 'chrome' in window;
3
3
 
4
- export {isFirefox, isChromium};
4
+ /**
5
+ * Whether the platform is a mobile browser.
6
+ * Copied from Expensify App https://github.com/Expensify/App/blob/90dee7accae79c49debf30354c160cab6c52c423/src/libs/Browser/index.website.ts#L41
7
+ *
8
+ */
9
+ const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Silk|Opera Mini/i.test(navigator.userAgent);
10
+
11
+ export {isFirefox, isChromium, isMobile};