Skip to content
This repository was archived by the owner on Jun 26, 2020. It is now read-only.

Commit c1e6afc

Browse files
authored
Merge pull request #251 from ckeditor/t/249
Fix: DropdownView should open upon arrow down key press. Closes #249.
2 parents 7117dca + 9dfc076 commit c1e6afc

File tree

2 files changed

+3
-31
lines changed

2 files changed

+3
-31
lines changed

src/dropdown/dropdownview.js

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -98,34 +98,6 @@ export default class DropdownView extends View {
9898

9999
// Toggle the visibility of the panel when the dropdown becomes open.
100100
panelView.bind( 'isVisible' ).to( this, 'isOpen' );
101-
102-
/**
103-
* The label of the dropdown.
104-
*
105-
* @observable
106-
* @member {String} #label
107-
*/
108-
109-
/**
110-
* Controls whether the dropdown is enabled (can be clicked).
111-
*
112-
* @observable
113-
* @member {Boolean} #isEnabled
114-
*/
115-
116-
/**
117-
* Controls whether the {@link #buttonView} is "pushed".
118-
*
119-
* @observable
120-
* @member {Boolean} #isOn
121-
*/
122-
123-
/**
124-
* (Optional) Whether the label of the dropdown is visible. See {@link module:ui/button/buttonview~ButtonView#withText}.
125-
*
126-
* @observable
127-
* @member {Boolean} #withText
128-
*/
129101
}
130102

131103
/**
@@ -149,7 +121,7 @@ export default class DropdownView extends View {
149121
// Open the dropdown panel using the arrow down key, just like with return or space.
150122
this.keystrokes.set( 'arrowdown', ( data, cancel ) => {
151123
// Don't open if the dropdown is disabled or already open.
152-
if ( this.isEnabled && !this.isOpen ) {
124+
if ( this.buttonView.isEnabled && !this.isOpen ) {
153125
this.isOpen = true;
154126
cancel();
155127
}

tests/dropdown/dropdownview.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ describe( 'DropdownView', () => {
127127
stopPropagation: sinon.spy()
128128
};
129129

130-
view.isEnabled = true;
130+
view.buttonView.isEnabled = true;
131131

132132
view.isOpen = true;
133133
view.keystrokes.press( keyEvtData );
@@ -149,7 +149,7 @@ describe( 'DropdownView', () => {
149149
stopPropagation: sinon.spy()
150150
};
151151

152-
view.isEnabled = false;
152+
view.buttonView.isEnabled = false;
153153
view.isOpen = false;
154154

155155
view.keystrokes.press( keyEvtData );

0 commit comments

Comments
 (0)