Fix #7513: Fix onBackspace handling of multiline messages with emojis or mentions #7542
      
        
          +1
        
        
          −1
        
        
          
        
      
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
First time contributor checklist:
Contributor checklist:
mainbranchpnpm run readyrun passes successfully (more about tests here)Description
When onBackspace occurs with the cursor at the beginning of a later line in a multiline message, it now short-circuits out to the default backspace handler. This prevents bespoke handling of emoji and mention deletions to erroneously be executed as described in #7513.
Fixes #7513
Testing Approach
Only manual testing was done on macOS 15.6.1 with a local
pnpm start, filled with my production data.Test 1\n Test 2\n@usernameMentionand also verified expected behavior (instead of an extra@sign being inserted after backspacing, no extra@was generated)I tried writing an automated
test-electrontest for the CompositionInput component, but got stuck on getting thequillRefto simulate events to. I think writing an automated test would include a refactoring of the component to expose it, or I am not savvy enough to figure it out, so I only went with my manual testing.