react-stepzilla icon indicating copy to clipboard operation
react-stepzilla copied to clipboard

Option preventEnterSubmission disables linebreaks in child textareas

Open johannesengl opened this issue 8 years ago • 4 comments

Hi there,

I just encountered an issue regarding the option preventEnterSubmission which disables enter submissions in all child inputs. I believe this behaviour isn't intended for textareas. I suggest updating the handleKeyDown method as follows:

  // handles keydown on enter being pressed in any Child component input area. in this case it goes to the next
  handleKeyDown(evt) {
    if (evt.which === 13) {
      if (!this.props.preventEnterSubmission && evt.target.type != 'textarea') {
        this.next();
      }
      else if(evt.target.type != 'textarea') {
        evt.preventDefault();
      }
    }
  }

johannesengl avatar Apr 26 '17 09:04 johannesengl

@johannesengl this is indeed a bug. Let me confirm and fix.

newbreedofgeek avatar Apr 26 '17 23:04 newbreedofgeek

@johannesengl I've fixed it and pushed v4.4.8. Please reinstall via npm and test and let me know.

Thanks!

newbreedofgeek avatar Apr 26 '17 23:04 newbreedofgeek

@johannesengl losing this as I've not heard any confirmation. Please reopen if the issue persists.

newbreedofgeek avatar Jun 05 '17 23:06 newbreedofgeek

Hi @newbreedofgeek I have a problem with that, in my first step I have a search input and want to search using enter key but if preventEnterSubmission is disable it won't work and if I set preventEnterSubmission to true it goes to the second page

moisesnandres avatar Oct 04 '17 22:10 moisesnandres