React-native-gifted-chat: Hitting the send button a few times after each other results in duplicate messages

Created on 13 Mar 2016  路  4Comments  路  Source: FaridSafi/react-native-gifted-chat

If I type "asdf" while after every letter quickly hitting the Send button, the expected result would be 4 messages:

  • A
  • S
  • D
  • F

Instead, I get these four messages:

  • A
  • As
  • Asd
  • Asdf

asdf

All 4 comments

This is probably the same issue as #70

I've tried quite a few different things to resolve this, but it seems very hard to fix. I've tried various ways of preventing the textInput from still accepting input after the send button has been pressed.

I've tried things like:

  • clearing the text value using setNativeProps (instead of through setState) to avoid depending on the render cycle
  • adding a second hidden TextInput and shifting the focus to this TextInput
  • disabling the TextInput

It seems that these blocking measures need quite some time to effectuate and that it's easy to keep typing some characters in the meanwhile.

Does anybody have ideas on how to resolve this? @alizbazar @bpeters perhaps?

Will this ever be fixed? :(

@alizbazar @bpeters

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Fr33maan picture Fr33maan  路  3Comments

arayaryoma picture arayaryoma  路  3Comments

luisar picture luisar  路  3Comments

tafelito picture tafelito  路  3Comments

emilkarl picture emilkarl  路  3Comments