react-native-gifted-chat+2.8.1.patch 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. diff --git a/node_modules/react-native-gifted-chat/lib/Composer.js b/node_modules/react-native-gifted-chat/lib/Composer.js
  2. index becd702..02ed162 100644
  3. --- a/node_modules/react-native-gifted-chat/lib/Composer.js
  4. +++ b/node_modules/react-native-gifted-chat/lib/Composer.js
  5. @@ -3,7 +3,7 @@ import { Platform, StyleSheet, TextInput, } from 'react-native';
  6. import { MIN_COMPOSER_HEIGHT, DEFAULT_PLACEHOLDER } from './Constant';
  7. import Color from './Color';
  8. import stylesCommon from './styles';
  9. -export function Composer({ composerHeight = MIN_COMPOSER_HEIGHT, disableComposer = false, keyboardAppearance = 'default', multiline = true, onInputSizeChanged, onTextChanged, placeholder = DEFAULT_PLACEHOLDER, placeholderTextColor = Color.defaultColor, text = '', textInputAutoFocus = false, textInputProps, textInputStyle, }) {
  10. +export function Composer({ composerHeight = MIN_COMPOSER_HEIGHT, disableComposer = false, keyboardAppearance = 'default', multiline = true, onInputSizeChanged, onTextChanged, placeholder = DEFAULT_PLACEHOLDER, placeholderTextColor = Color.defaultColor, text = '', textInputAutoFocus = false, textInputProps, ref, textInputStyle, }) {
  11. const dimensionsRef = useRef(null);
  12. const determineInputSizeChange = useCallback((dimensions) => {
  13. // Support earlier versions of React Native on Android.
  14. @@ -32,7 +32,7 @@ export function Composer({ composerHeight = MIN_COMPOSER_HEIGHT, disableComposer
  15. },
  16. }),
  17. },
  18. - ]} autoFocus={textInputAutoFocus} value={text} enablesReturnKeyAutomatically underlineColorAndroid='transparent' keyboardAppearance={keyboardAppearance} {...textInputProps}/>);
  19. + ]} autoFocus={textInputAutoFocus} value={text} enablesReturnKeyAutomatically underlineColorAndroid='transparent' keyboardAppearance={keyboardAppearance} ref={ref}/>);
  20. }
  21. const styles = StyleSheet.create({
  22. textInput: {
  23. diff --git a/node_modules/react-native-gifted-chat/lib/GiftedChat/index.js b/node_modules/react-native-gifted-chat/lib/GiftedChat/index.js
  24. index 4fc42d2..073d537 100644
  25. --- a/node_modules/react-native-gifted-chat/lib/GiftedChat/index.js
  26. +++ b/node_modules/react-native-gifted-chat/lib/GiftedChat/index.js
  27. @@ -6,6 +6,7 @@ import { Platform, View, } from 'react-native';
  28. import { Actions } from '../Actions';
  29. import { Avatar } from '../Avatar';
  30. import Bubble from '../Bubble';
  31. +import {Platform as LocalPlatform} from 'react-native'
  32. import { Composer } from '../Composer';
  33. import { MAX_COMPOSER_HEIGHT, MIN_COMPOSER_HEIGHT, TEST_ID } from '../Constant';
  34. import { Day } from '../Day';
  35. @@ -195,9 +196,10 @@ function GiftedChat(props) {
  36. onSend: _onSend,
  37. onInputSizeChanged,
  38. onTextChanged: _onInputTextChanged,
  39. + ref: textInputRef,
  40. textInputProps: {
  41. ...textInputProps,
  42. - ref: textInputRef,
  43. + // ref: textInputRef,
  44. maxLength: isTypingDisabled ? 0 : maxInputLength,
  45. },
  46. };