diff --git a/dist/client/handleShortCuts.js b/dist/client/handleShortCuts.js index 7b702e708bee..59bb54d1559a 100644 --- a/dist/client/handleShortCuts.js +++ b/dist/client/handleShortCuts.js @@ -17,6 +17,7 @@ function isModifierPressed(e) { } function handleShortCuts(e, syncedStore) { + console.log(e); if (isModifierPressed(e) && e.keyCode === 80) { e.preventDefault(); var newData = (0, _extends3.default)({}, syncedStore.getData()); diff --git a/dist/client/ui/FuzzySearch.js b/dist/client/ui/FuzzySearch.js index b69a3d38ae04..af5f72544c56 100644 --- a/dist/client/ui/FuzzySearch.js +++ b/dist/client/ui/FuzzySearch.js @@ -182,9 +182,9 @@ var FuzzySearch = function (_Component) { } }, { key: 'handleChange', - value: function handleChange() { + value: function handleChange(e) { this.setState({ - results: this.fuse.search(this.refs.searchBox.value) + results: this.fuse.search(e.target.value) }); } }, { @@ -194,11 +194,12 @@ var FuzzySearch = function (_Component) { var className = _props.className; var width = _props.width; var placeholder = _props.placeholder; + var show = _props.show; var mainClass = (0, _classnames2.default)('react-fuzzy-search', className); - var showSearchBox = syncedStore.getData().showSearchBox; + var showSearchBox = show || syncedStore.getData().showSearchBox; return _react2.default.createElement( 'span', @@ -240,11 +241,13 @@ FuzzySearch.propTypes = { width: _react.PropTypes.number, list: _react.PropTypes.array.isRequired, options: _react.PropTypes.object.isRequired, - placeholder: _react.PropTypes.string + placeholder: _react.PropTypes.string, + show: _react.PropTypes.bool }; FuzzySearch.defaultProps = { - width: 430 + width: 430, + show: false }; exports.default = FuzzySearch; \ No newline at end of file diff --git a/dist/client/ui/controls.js b/dist/client/ui/controls.js index 3000e20d2eef..0a0a595621a9 100644 --- a/dist/client/ui/controls.js +++ b/dist/client/ui/controls.js @@ -28,9 +28,9 @@ var _react = require('react'); var _react2 = _interopRequireDefault(_react); -var _FuzzySearch = require('./FuzzySearch'); +var _fuzzySearch = require('./fuzzySearch'); -var _FuzzySearch2 = _interopRequireDefault(_FuzzySearch); +var _fuzzySearch2 = _interopRequireDefault(_fuzzySearch); var _text_filter = require('./text_filter'); @@ -369,7 +369,7 @@ var StorybookControls = function (_React$Component) { '✕' ) ), - _react2.default.createElement(_FuzzySearch2.default, { + _react2.default.createElement(_fuzzySearch2.default, { list: this.formatStoryForSearch(), options: options, width: 430, diff --git a/package.json b/package.json index 75bc590b70e0..78f247f72b88 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "dev": "nodemon --watch src --exec 'npm run prepublish'" }, "dependencies": { - "@kadira/react-split-pane": "^1.2.0", + "@kadira/react-split-pane": "^1.3.0", "babel-core": "^6.3.15", "babel-loader": "^6.2.0", "babel-polyfill": "^6.3.15",