mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/WikiEditor
synced 2024-11-24 00:06:49 +00:00
Avoid "Cannot read property 'top' of undefined" in toolbar
Can happen when using up and down keys without selection Bug: T282607 Change-Id: Ibf7b4711fe7d0ebc14638a77770acff9149a9d7a
This commit is contained in:
parent
1fc35f7b2b
commit
fbcc93d98c
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue