bonafideduck / react-highlight-within-textarea

React component for highlighting bits of text within a textarea
100 stars 13 forks source link

Bug on mobile browsers #114

Open TheBoringBOT opened 2 years ago

TheBoringBOT commented 2 years ago

Bug: Select all -> delete on mobile causes the app to white screen.

I though it was just my app but tested on your demo page and the issue is the same.

Tested with: Chrome Browser Android

Any way to remove the draftjs and use only the port you done of jquery-highlight-.....?

mahenk1 commented 2 years ago

+1

Facing the same issue on Android Chrome browser Throws errors "t.blockMap" is not a function

bonafideduck commented 2 years ago

I'm not seeing the issue on IOS Safari. If you really want to use the older port, you can try it at version 1.0.1. It has lots of failures when line wrapping is involved. In addition, I've made a lot of changes with 3.0.0-alpha. In porting to typescript, I may have inadvertently fixed your issue.

gabrii commented 1 year ago

Having the same issue on latest chrome on android, as many of my users as well.

I resolved it by wrapping the component on an error boundry that just resets, and it works.

  <ErrorBoundary
    fallbackRender={({error, resetErrorBoundary }) => (resetErrorBoundary())}
    onReset={details => {}}
  >
     <HighlightWithinTextarea ... />
   </ErrorBoundary>

It's a bad solution, specially as the user looses focus, the keyboard disappears, and they have to click on the text area again (going to try to get some auto focus later to avoid this). But for now this will do for me.