react-native-zss-rich-text-editor icon indicating copy to clipboard operation
react-native-zss-rich-text-editor copied to clipboard

Use core WebView

Open armstrongnate opened this issue 7 years ago • 5 comments

Fixes #14 as of react native 0.42.0.

armstrongnate avatar Mar 21 '17 20:03 armstrongnate

Finally was able to get this library working with this code. Two notes so far:

  • The WebView navigation bar shows and doesn't go away (the "<" ">" "Done" gray bar at the bottom of the view)
  • I can't get images to show in the editor, I've been trying:
this.editor.insertImage({
  src: 'https://example.com/my-image.jpg',
  height: 100,
  width: 100
})

rwoody avatar Mar 29 '17 20:03 rwoody

Is anyone going o merge this PR?

razvan-tudosa avatar Apr 03 '17 07:04 razvan-tudosa

Thanks for the contribution @n8armstrong and sorry for the late reply.

We're still considering what to do with this issue. Although WebView Bridge functionality is now part of the core in latest RN versions, there's still something missing which I'm not sure will ever be supported directly in RN. I'm talking about the default "input accessory view" which is shown in iOS for any input inside the native WebView (this is the bar above the keyboard that @rwoody mentioned).

The WebView bridge package takes care of this. While we can do it ourselves, it still means that we'll need to add another native dependency. So it's unclear what's the best solution here.

Any thoughts/suggestions are welcome.

artald avatar Apr 03 '17 12:04 artald

While we can do it ourselves, it still means that we'll need to add another native dependency. So it's unclear what's the best solution here.

Any thoughts/suggestions are welcome.

I would say make this compatible with RN WebView with an additional (hopefully smaller?) native library.

vladikoff avatar Apr 01 '18 01:04 vladikoff

@armstrongnate thanks alot! I forked this repo and using it and your PR helps me nowadays.

@rwoody I know it's been a while, but the issue is inside WebviewMessageHandler. data must be stringified when is sent to the html:

// ....
case actions.insertImage:
  return `zss_editor.insertImage('${JSON.stringify(action.data)}');`;

Anyways, the issue I'm facing is that auto-scrolling doesn't work on iOS, tried a bunch of hacks and fixes without any success, does anyone knows why?

sergiulucaci avatar Mar 06 '20 09:03 sergiulucaci