├── .babelrc ├── .eslintrc ├── .gitignore ├── .npmignore ├── .travis.yml ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── README-template.md ├── README.md ├── UPGRADE_GUIDE.md ├── bin ├── generate-api-doc.js └── generate-readme.js ├── examples ├── app.css ├── async-data │ ├── app.js │ └── index.html ├── custom-menu │ ├── app.js │ └── index.html ├── index.html ├── managed-menu-visibility │ ├── app.js │ └── index.html └── static-data │ ├── app.js │ └── index.html ├── lib ├── Autocomplete.js ├── __tests__ │ ├── .eslintrc │ ├── Autocomplete-test.js │ └── __snapshots__ │ │ └── Autocomplete-test.js.snap ├── index.js └── utils.js ├── package.json └── scripts ├── build ├── component.sh └── examples.sh ├── coverage.sh ├── generate-readme.sh ├── gh-pages.sh ├── release.sh ├── start ├── async-data.sh ├── custom-menu.sh ├── managed-menu-visibility.sh ├── server.sh └── static-data.sh └── test ├── index.sh ├── jest.sh └── lint.sh /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015", "stage-0", "react"], 3 | "env": { 4 | "development": { 5 | "presets": ["react-hmre"] 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "rackt", 3 | "plugins": [ 4 | "react" 5 | ], 6 | "rules": { 7 | "react/jsx-uses-react": "error", 8 | "react/jsx-uses-vars": "error", 9 | "no-trailing-spaces": "error", 10 | "array-bracket-spacing": 0, 11 | "comma-dangle": 0 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /build/ 2 | /dist/ 3 | /examples/__build__ 4 | /node_modules/ 5 | /coverage/ 6 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | **/.* 2 | **/__tests__ 3 | examples 4 | CONTRIBUTING.md 5 | bower.json 6 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "4" 4 | - "6" 5 | - "stable" 6 | sudo: false 7 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # CHANGELOG 2 | We try to follow [http://keepachangelog.com/](http://keepachangelog.com/) recommendations for easier to update & more readable change logs. 3 | 4 | ## [Unreleased] 5 | _(add items here for easier creation of next log entry)_ 6 | 7 | ## [1.8.1] - 2018-02-11 8 | ### Fixed 9 | - Prevent menu from closing prematurely on mobile (#308) 10 | - Fix for up-arrow not working after `props.isItemSelectable` was added (#315) 11 | 12 | ## [1.8.0] - 2018-02-04 13 | ### Added 14 | - `props.isItemSelectable` which allows rendering items that will not function as selectable items, but instead as static information/decoration elements such as headers (thanks to @rssteffey with help from @rmcauley) (#241) 15 | 16 | ## [1.7.3] - 2018-02-04 17 | ### Fixed 18 | - Release focus-lock when user uses Enter to close menu (thanks to @Fralleee for discovering this edge case) (#304) 19 | 20 | ## [1.7.2] - 2017-10-8 21 | ### Changed 22 | - Include React v16 in peer-dependency version range (#280) 23 | 24 | ## [1.7.1] - 2017-08-20 25 | ### Fixed 26 | - Do not select an item on Enter keypress when keyCode is not 13 (#201) 27 | 28 | ## [1.7.0] - 2017-08-20 29 | ### Added 30 | - `props.selectOnBlur` to select any highlighted item on blur (#251) 31 | 32 | ## [1.6.0] - 2017-08-19 33 | ### Added 34 | - `props.renderInput` to allow custom `` components (#247) 35 | 36 | ## [1.5.10] - 2017-07-20 37 | ### Fixed 38 | - Make setState updaters compatible with preact-compat (#258) 39 | 40 | ## [1.5.9] - 2017-06-16 41 | ### Fixed 42 | - Reworked focus management to be more consistent and handle edge cases (async focus, input out of viewport, etc., read more in #153, #246, #222, & #240) 43 | 44 | ## [1.5.8] - 2017-06-16 45 | ### Fixed 46 | - Ensure top match is highlighted even if `props.items` arrive out of order (async) (#249) 47 | 48 | ## [1.5.7] - 2017-06-14 49 | ### Changed 50 | - Improve auto highlight logic, reduces render count and fixes some edge cases 51 | - Make `props.debug` only show renders relating to the current instance 52 | 53 | ## [1.5.6] - 2017-06-01 54 | ### Fixed 55 | - Include prop-types in UMD build, fixes an unintentional breaking change introduced in 1.5.5 56 | 57 | ## [1.5.5] - 2017-05-29 58 | ### Fixed 59 | - Replace deprecated React.PropTypes with prop-types module (#232) 60 | - Replace deprecated React.createClass with class syntax (#232) 61 | 62 | ## [1.5.4] - 2017-05-25 63 | ### Fixed 64 | - Delay re-focus until all actions have been processed (#240) 65 | 66 | ## [1.5.3] - 2017-05-14 67 | ### Fixed 68 | - Prevent menu from closing when interacting with scrollbar in IE (#211, #222) 69 | 70 | ## [1.5.2] - 2017-05-11 71 | ### Fixed 72 | - Prevent onFocus and onBlur when selecting an item (#229) 73 | 74 | ## [1.5.1] - 2017-04-27 75 | ### Fixed 76 | - Remove logic that selected highlighted item on input click. This was no longer desired after typeahead was removed. 77 | 78 | ## [1.5.0] - 2017-04-23 79 | ### Added 80 | - Public imperative API which can be used to perform actions such as focus, blur, set selection range, etc 81 | 82 | ## [1.4.4] - 2017-04-16 83 | ### Fixed 84 | - Prevent highlighted selection from being cleared when pressing keys that don't modify `input.value` (e.g. ctrl, alt, left/right arrows, etc) 85 | 86 | ## [1.4.3] - 2017-04-16 87 | ### Fixed 88 | - Ensure menu positions are set when specifying `props.open` 89 | 90 | ## [1.4.2] - 2017-04-02 91 | ### Fixed 92 | - Workaround for "Cannot read property 'ownerDocument' of null" 93 | 94 | ## [1.4.1] - 2017-03-16 95 | ### Fixed 96 | - Add missing aria-expanded attribute 97 | 98 | ## [1.4.0] - 2016-11-07 99 | ### Added 100 | - Add all event handlers specified in `props.inputProps` to `` 101 | 102 | ## [1.3.1] - 2016-08-01 103 | ### Changed 104 | - Re-publish without `node_modules` and `coverage` included in tarball 105 | 106 | ## [1.3.0] - 2016-08-01 107 | ### Added 108 | - `props.open` to manually control when the menu is open/closed (#163) 109 | - `props.onMenuVisibilityChange` callback that is invoked every time the menu is opened/closed by `Autocomplete`'s internal logic. Pairs well with `props.open` for granulated control over the menu's visibility (#163) 110 | 111 | ### Removed 112 | - `bower.json` has been removed from the repo 113 | 114 | ## [1.2.1] - 2016-08-09 115 | ### Fixed 116 | - `build/package.json` incorrectly stated `1.1.0` for the version, a quick rebuild and 117 | patch version publish got these back in sync. 118 | 119 | ## [1.2.0] - 2016-08-09 120 | ### Added 121 | - `props.autoHighlight` to toggle automatic highlighting of top match (see #146 & #159) 122 | 123 | ### Fixed 124 | - Bug which prevented menu from closing properly in IE (see #153) 125 | - .babelrc presets were causing 1 user(s) to not be able to run tests locally with Jest 126 | 127 | ## [1.1.0] - 2016-08-02 128 | ### Added 129 | - Ability to return custom components from renderMenu/renderItem (see #127) 130 | - Added missing `propTypes` 131 | - Jest for testing (replaces mocha/isparta) 132 | - eslint consuming the rackt config 133 | 134 | ### Fixed 135 | - Custom Menu Example (#81) 136 | - Bug causing menu to close immediately when clicking into input (#84) 137 | - Bug referencing `this.state.value` (has since been moved to props) 138 | - Reset `highlightedIndex` when it's outside `items.length` (#139) 139 | - Removed typeahead behavior for improved mobile functionality (#40, #111, #152) 140 | 141 | ### Updated 142 | - rackt-cli (#131, #51, #107) 143 | - repo urls (#114) 144 | - Jest ignore rules & configurations 145 | 146 | 147 | ## [1.0.1] - 2016-06-26 148 | -------------------------------------- 149 | 150 | - Fixed compatibility issues with React 15.x, removed use of previously deprecated APIs 151 | 152 | v1.0.0 - 17 June 2016 153 | -------------------------------------- 154 | 155 | - Additional failing tests fixed, pre-publish build with 1.0.0 changes 156 | 157 | v1.0.0-rc6 - 5 June 2016 158 | -------------------------------------- 159 | 160 | - Updated propTypes for several props being used but not included here 161 | - Several issues and fixes from #68, #84, #92, #93, #103, #104, #106 162 | - Actually built the build/dist files and included them in the publish 163 | 164 | v1.0.0-rc5 - 5 June 2016 165 | -------------------------------------- 166 | 167 | - Dependencies clean up (removed duplicates and large lodash dependency) 168 | - Demoted React to peerDependency 169 | 170 | 171 | v1.0.0-rc3 - 25 May 2016 172 | -------------------------------------- 173 | 174 | - Removed lodash dependency, reducing overall package size 175 | - Removed iternally rendered `