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

Commit

Permalink
Merge pull request #551 from ckeditor/i/6548
Browse files Browse the repository at this point in the history
Other: Removed the obsolete `DropdownView#focusTracker`. Closes ckeditor/ckeditor5#6548.

MINOR BREAKING CHANGE: The `DropdownView#focusTracker` property has been removed as it served no purpose.
  • Loading branch information
Reinmar authored Apr 4, 2020
2 parents 5d86638 + 43b2e3c commit ac750c7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 31 deletions.
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 ac750c7

Please sign in to comment.