Merge "Avoid "Cannot read property 'top' of undefined" in toolbar"

This commit is contained in:
jenkins-bot 2021-06-01 21:14:20 +00:00 committed by Gerrit Code Review
commit 929c6010b6

View file

@ -797,7 +797,8 @@
handleKeyDown: function ( $element, event, $parent ) {
var $nextItem,
$currentItem = $element.find( '.wikiEditor-character-highlighted' ),
optionTop = $parent.find( '.wikiEditor-character-highlighted' ).offset().top,
optionOffset = $parent.find( '.wikiEditor-character-highlighted' ).offset(),
optionTop = optionOffset ? optionOffset.top : 0,
selectTop = $parent.offset().top;
switch ( event.keyCode ) {
// Up arrow