Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix spellCheck and autoCorrect props #1292

Merged

Conversation

christophpurrer
Copy link

Please select one of the following

  • I am removing an existing difference between facebook/react-native and microsoft/react-native-macos 馃憤
  • I am cherry-picking a change from Facebook's react-native into microsoft/react-native-macos 馃憤
  • I am making a fix / change for the macOS implementation of react-native
  • I am making a change required for Microsoft usage of react-native

Summary

This fixes autoCorrect to correctly map to automaticSpellingCorrectionEnabled, and spellCheck to map to continuousSpellCheckingEnabled.

Note: automaticTextReplacementEnabled is a different feature than automaticSpellingCorrectionEnabled
https://developer.apple.com/documentation/appkit/nstextview/1449210-automatictextreplacementenabled
https://developer.apple.com/documentation/appkit/nstextview/1449254-isautomaticspellingcorrectionena

Changelog

[macOS] [Fixed] - Fix spellCheck and autoCorrect props

Test Plan

Using this sample

  {
    title: 'Auto-focus',
    render: function (): React.Node {
      return (
      <>
        <TextInput
          spellCheck={true}
          style={{backgroundColor: 'white', margin: 10}}
          accessibilityLabel="spellCheck"
        />        
        <TextInput
          grammarCheck={true}
          style={{backgroundColor: 'white', margin: 10}}
          accessibilityLabel="grammarCheck"
        />
        <TextInput
          autoCorrect={true}
          style={{backgroundColor: 'white', margin: 10}}
          accessibilityLabel="autoFocus"
        />
        <View style={{margin: 50, width:200, height:100, backgroundColor: 'red'}} />
        <TextInput
          spellCheck={false}
          style={{backgroundColor: 'white', margin: 10}}
          accessibilityLabel="spellCheck"
        />        
        <TextInput
          grammarCheck={false}
          style={{backgroundColor: 'white', margin: 10}}
          accessibilityLabel="grammarCheck"
        />
        <TextInput
          autoCorrect={false}
          style={{backgroundColor: 'white', margin: 10}}
          accessibilityLabel="autoFocus"
        />
      </>
      );
    },
  },

Before

Errors shown in 00:00:02 and 00:00:06

before.mov

After

Works as anticipated

Screen.Recording.2022-07-25.at.3.43.29.PM.mov

Summary: This fixes `autoCorrect` to correctly map to `automaticSpellingCorrectionEnabled`, and `spellCheck` to map to `continuousSpellCheckingEnabled`.

Note: automaticTextReplacementEnabled is a different feature than automaticSpellingCorrectionEnabled
https://developer.apple.com/documentation/appkit/nstextview/1449210-automatictextreplacementenabled
https://developer.apple.com/documentation/appkit/nstextview/1449254-isautomaticspellingcorrectionena
@christophpurrer christophpurrer requested a review from a team as a code owner July 25, 2022 22:50
christophpurrer pushed a commit to christophpurrer/react-native-macos that referenced this pull request Jul 25, 2022
Similar to microsoft#1292 this adds a macOS only property to toggle grammarCheck on RCTUITextField
christophpurrer pushed a commit to christophpurrer/react-native-macos that referenced this pull request Jul 25, 2022
Similar to microsoft#1292 this adds a macOS only property to toggle grammarCheck on RCTUITextField
@Saadnajmi Saadnajmi merged commit 1c38432 into microsoft:main Jul 26, 2022
christophpurrer pushed a commit to christophpurrer/react-native-macos that referenced this pull request Jul 26, 2022
Similar to microsoft#1292 this adds a macOS only property to toggle grammarCheck on RCTUITextField
christophpurrer pushed a commit to christophpurrer/react-native-macos that referenced this pull request Jul 26, 2022
Similar to microsoft#1292 this adds a macOS only property to toggle grammarCheck on RCTUITextField
christophpurrer pushed a commit to christophpurrer/react-native-macos that referenced this pull request Aug 9, 2022
Summary: This fixes `autoCorrect` to correctly map to `automaticSpellingCorrectionEnabled`, and `spellCheck` to map to `continuousSpellCheckingEnabled`.

Note: automaticTextReplacementEnabled is a different feature than automaticSpellingCorrectionEnabled
https://developer.apple.com/documentation/appkit/nstextview/1449210-automatictextreplacementenabled
https://developer.apple.com/documentation/appkit/nstextview/1449254-isautomaticspellingcorrectionena

Co-authored-by: Scott Kyle <skyle@fb.com>
# Conflicts:
#	Libraries/Text/TextInput/Singleline/RCTUITextField.h
#	Libraries/Text/TextInput/Singleline/RCTUITextField.m
christophpurrer pushed a commit to christophpurrer/react-native-macos that referenced this pull request Aug 9, 2022
Summary: This fixes `autoCorrect` to correctly map to `automaticSpellingCorrectionEnabled`, and `spellCheck` to map to `continuousSpellCheckingEnabled`.

Note: automaticTextReplacementEnabled is a different feature than automaticSpellingCorrectionEnabled
https://developer.apple.com/documentation/appkit/nstextview/1449210-automatictextreplacementenabled
https://developer.apple.com/documentation/appkit/nstextview/1449254-isautomaticspellingcorrectionena

Co-authored-by: Scott Kyle <skyle@fb.com>
# Conflicts:
#	Libraries/Text/TextInput/Singleline/RCTUITextField.h
#	Libraries/Text/TextInput/Singleline/RCTUITextField.m
christophpurrer pushed a commit to christophpurrer/react-native-macos that referenced this pull request Aug 10, 2022
Summary: This fixes `autoCorrect` to correctly map to `automaticSpellingCorrectionEnabled`, and `spellCheck` to map to `continuousSpellCheckingEnabled`.

Note: automaticTextReplacementEnabled is a different feature than automaticSpellingCorrectionEnabled
https://developer.apple.com/documentation/appkit/nstextview/1449210-automatictextreplacementenabled
https://developer.apple.com/documentation/appkit/nstextview/1449254-isautomaticspellingcorrectionena

Co-authored-by: Scott Kyle <skyle@fb.com>
# Conflicts:
#	Libraries/Text/TextInput/Singleline/RCTUITextField.h
#	Libraries/Text/TextInput/Singleline/RCTUITextField.m
shwanton pushed a commit to shwanton/react-native-macos that referenced this pull request Feb 13, 2023
Summary: This fixes `autoCorrect` to correctly map to `automaticSpellingCorrectionEnabled`, and `spellCheck` to map to `continuousSpellCheckingEnabled`.

Note: automaticTextReplacementEnabled is a different feature than automaticSpellingCorrectionEnabled
https://developer.apple.com/documentation/appkit/nstextview/1449210-automatictextreplacementenabled
https://developer.apple.com/documentation/appkit/nstextview/1449254-isautomaticspellingcorrectionena

Co-authored-by: Scott Kyle <skyle@fb.com>
shwanton pushed a commit to shwanton/react-native-macos that referenced this pull request Mar 10, 2023
Summary: This fixes `autoCorrect` to correctly map to `automaticSpellingCorrectionEnabled`, and `spellCheck` to map to `continuousSpellCheckingEnabled`.

Note: automaticTextReplacementEnabled is a different feature than automaticSpellingCorrectionEnabled
https://developer.apple.com/documentation/appkit/nstextview/1449210-automatictextreplacementenabled
https://developer.apple.com/documentation/appkit/nstextview/1449254-isautomaticspellingcorrectionena

Co-authored-by: Scott Kyle <skyle@fb.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants