Skip to content

Commit 1ae4931

Browse files
layershifterlevithomason
authored andcommitted
fix(Dropdown): omit moveSelectionBy() when options aren't defined (Semantic-Org#2119)
1 parent 2bddf40 commit 1ae4931

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/modules/Dropdown/Dropdown.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -975,11 +975,12 @@ export default class Dropdown extends Component {
975975
debug(`offset: ${offset}`)
976976

977977
const options = this.getMenuOptions()
978-
const lastIndex = options.length - 1
979978

980979
// Prevent infinite loop
981-
if (_.every(options, 'disabled')) return
980+
// TODO: remove left part of condition after children API will be removed
981+
if (options === undefined || _.every(options, 'disabled')) return
982982

983+
const lastIndex = options.length - 1
983984
// next is after last, wrap to beginning
984985
// next is before first, wrap to end
985986
let nextIndex = startIndex + offset

0 commit comments

Comments
 (0)