diff --git a/CHANGELOG.md b/CHANGELOG.md index ab761d9a5..bc9635aa9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ The format is based on This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +## [v3.6.13] - 2020-10-12 +### Fixed +- Comment mention dropdown interfering with adding newlines to comment + + ## [v3.6.12] - 2020-10-07 ### Added - Updated translations and new Vietnamese locale (thank you translators!) diff --git a/package.json b/package.json index 344addfa0..9a0ed2c9c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "maproulette3", - "version": "3.6.12", + "version": "3.6.13", "private": true, "dependencies": { "@apollo/client": "^3.1.1", diff --git a/src/components/AutosuggestTextBox/AutosuggestMentionTextArea.js b/src/components/AutosuggestTextBox/AutosuggestMentionTextArea.js index 9999ac6f1..2d617678f 100644 --- a/src/components/AutosuggestTextBox/AutosuggestMentionTextArea.js +++ b/src/components/AutosuggestTextBox/AutosuggestMentionTextArea.js @@ -60,10 +60,14 @@ export default class AutosuggestMentionTextArea extends Component { } } - handleKeyDown = e => { - if (e.key === "Enter") { - // Don't let enter key potentially submit a form - e.preventDefault() + handleKeyDown = (e, dropdown) => { + if (dropdown.isDropdownVisible) { + if (e.key === "ArrowUp" || + e.key === "ArrowDown" || + e.key === "ArrowRight" || + e.key === "ArrowLeft") { + e.preventDefault() + } } } @@ -184,7 +188,7 @@ export default class AutosuggestMentionTextArea extends Component { this.props.inputClassName, "mr-flex-grow mr-w-full mr-h-full mr-outline-none" )} - onKeyDown={this.handleKeyDown} + onKeyDown={(e) => this.handleKeyDown(e, dropdown)} onFocus={(e) => this.setState({textBoxActive: true})} onBlur={(e) => this.setState({textBoxActive: false})} placeholder={this.props.placeholder}