Giter Site home page Giter Site logo

Comments (4)

cortinico avatar cortinico commented on August 25, 2024 1

@cortinico Can you provide the PR that fixes this issue?

Sorry I picked the wrong label

from react-native.

TheProBro avatar TheProBro commented on August 25, 2024

@cortinico Can you provide the PR that fixes this issue?

from react-native.

shubhamguptadream11 avatar shubhamguptadream11 commented on August 25, 2024

@TheProBro @cortinico

  1. Selecting and deleting a word also deletes a space to the left of it, but in this case onSelectionChange fires first

Regarding this issue.

This is the default iOS behaviour.
I checked this on system messaging app. Shared recording for reference.

Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-07-10.at.15.55.35.mp4

Findings:

  • textView(_:shouldChangeTextIn:replacementText:) [UITextField delegate method] will be called first when we press backspace on keyboard with replacement string "". This will detect that text on Edit Text to be changed(Not reflected yet) and return YES from this function.
  • Returning YES from this function will further call textViewDidChangeSelection[UITextField delegate method] with removed one left space character.

Solution:

  • Since we didn't have any callbacks now where that one extra space is removed. We can live with this default behaviour.
  • Or else we can keep previous text from textView(_:shouldChangeTextIn:replacementText:) method and check if text got changed in textViewDidChangeSelection then add that extra space. [Here, lots of edge cases needs to handled]

For this issue:

For the multiline textinput, for the first keypress onSelectionChange fires first, but for later key presses onChangeText/onChange fire first

I started debugging on this.

from react-native.

shubhamguptadream11 avatar shubhamguptadream11 commented on August 25, 2024

@TheProBro. @cortinico
Fix for this issue: #45377

For the multiline textinput, for the first keypress onSelectionChange fires first, but for later key presses onChangeText/onChange fire first

Added my findings in PR itself.

from react-native.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.