forem / ForemWebView-ios

Forem core interface SDK
GNU General Public License v3.0
22 stars 7 forks source link

Image Upload - Native Bridge fix #32

Closed fdocr closed 3 years ago

fdocr commented 3 years ago

Fixes a JS problem in injectImageMessage where Preact no longer accepts change as an event that will trigger onChange callbacks. We need to use input instead. It appears to be related with a JS dependency that changed this behavior.

nickytonline commented 3 years ago

For some more context on this to anyone that comes across this issue, I'm guessing this started happening when we added the mention autocomplete. It's not directly related to the mention autocomplete, but the mention autocomplete required the use of preact-compat which converts onChange events to onInput (since Preact uses web browser based events and not the React synthetic events).

Since we were generating a DOM event programmatically in the iOS app, a change event no longer worked, so an input event was required instead.