From 53bff6090cd0670c45b4a3bcab273e4da4180bc9 Mon Sep 17 00:00:00 2001 From: jquense Date: Tue, 8 Dec 2015 13:50:20 -0500 Subject: [PATCH] [fixed] multiselect calls preventDefault --- src/Multiselect.jsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Multiselect.jsx b/src/Multiselect.jsx index a9b224ae6..c6ede6f53 100644 --- a/src/Multiselect.jsx +++ b/src/Multiselect.jsx @@ -423,18 +423,21 @@ var Multiselect = React.createClass({ else if (isOpen) this.setState({ focusedItem: prev, ...nullTag }) } else if (key === 'End') { + e.preventDefault() if ( isOpen ) this.setState({ focusedItem: list.last(), ...nullTag }) else tagList && this.setState({ focusedTag: tagList.last() }) } else if (key === 'Home') { + e.preventDefault() if (isOpen) this.setState({ focusedItem: list.first(), ...nullTag }) else tagList && this.setState({ focusedTag: tagList.first() }) } - else if (isOpen && key === 'Enter') + else if (isOpen && key === 'Enter') { + e.preventDefault(); (ctrlKey && this.props.onCreate) || focusedItem === null ? this._onCreate(this.props.searchTerm) : this._onSelect(this.state.focusedItem) - + } else if (key === 'Escape') isOpen ? this.close() : tagList && this.setState(nullTag)