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

Commit

Permalink
Merge branch 'master' into i/6319
Browse files Browse the repository at this point in the history
  • Loading branch information
oleq committed Apr 6, 2020
2 parents c71c323 + b30bdd9 commit bd93bd0
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 32 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ language: node_js
services:
- xvfb
node_js:
- '8'
- '10'
cache:
yarn: true
branches:
Expand Down
12 changes: 0 additions & 12 deletions src/dropdown/dropdownview.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
*/

import View from '../view';
import FocusTracker from '@ckeditor/ckeditor5-utils/src/focustracker';
import KeystrokeHandler from '@ckeditor/ckeditor5-utils/src/keystrokehandler';

import '../../theme/components/dropdown/dropdown.css';
Expand Down Expand Up @@ -155,14 +154,6 @@ export default class DropdownView extends View {
*/
this.set( 'panelPosition', 'auto' );

/**
* Tracks information about DOM focus in the dropdown.
*
* @readonly
* @member {module:utils/focustracker~FocusTracker}
*/
this.focusTracker = new FocusTracker();

/**
* Instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}. It manages
* keystrokes of the dropdown:
Expand Down Expand Up @@ -277,9 +268,6 @@ export default class DropdownView extends View {
// Listen for keystrokes coming from within #element.
this.keystrokes.listenTo( this.element );

// Register #element in the focus tracker.
this.focusTracker.add( this.element );

const closeDropdown = ( data, cancel ) => {
if ( this.isOpen ) {
this.buttonView.focus();
Expand Down
19 changes: 0 additions & 19 deletions tests/dropdown/dropdownview.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import DropdownView from '../../src/dropdown/dropdownview';
import KeystrokeHandler from '@ckeditor/ckeditor5-utils/src/keystrokehandler';
import FocusTracker from '@ckeditor/ckeditor5-utils/src/focustracker';
import { keyCodes } from '@ckeditor/ckeditor5-utils/src/keyboard';
import ButtonView from '../../src/button/buttonview';
import DropdownPanelView from '../../src/dropdown/dropdownpanelview';
Expand Down Expand Up @@ -72,10 +71,6 @@ describe( 'DropdownView', () => {
expect( view.panelPosition ).to.equal( 'auto' );
} );

it( 'creates #focusTracker instance', () => {
expect( view.focusTracker ).to.be.instanceOf( FocusTracker );
} );

it( 'creates #keystrokeHandler instance', () => {
expect( view.keystrokes ).to.be.instanceOf( KeystrokeHandler );
} );
Expand Down Expand Up @@ -214,20 +209,6 @@ describe( 'DropdownView', () => {
view.element.remove();
} );

it( 'adds #element to #focusTracker', () => {
const view = new DropdownView( locale,
new ButtonView( locale ),
new DropdownPanelView( locale ) );

const spy = sinon.spy( view.focusTracker, 'add' );

view.render();
sinon.assert.calledOnce( spy );
sinon.assert.calledWithExactly( spy, view.element );

view.element.remove();
} );

describe( 'activates keyboard navigation for the dropdown', () => {
it( 'so "arrowdown" opens the #panelView', () => {
const keyEvtData = {
Expand Down

0 comments on commit bd93bd0

Please sign in to comment.