diff --git a/js/listeners/KeyboardDragListener.ts b/js/listeners/KeyboardDragListener.ts index ec357bd4b..7fd58d77b 100644 --- a/js/listeners/KeyboardDragListener.ts +++ b/js/listeners/KeyboardDragListener.ts @@ -128,7 +128,7 @@ type SelfOptions = { // If provided, it will be synchronized with the drag position in the model frame, applying provided transforms as // needed. Most useful when used with transform option - positionProperty?: TProperty | null; + positionProperty?: Pick, 'value'> | null; // If provided, this will be the conversion between the view and model coordinate frames. Usually most useful when // paired with the positionProperty. @@ -184,7 +184,7 @@ class KeyboardDragListener extends EnabledComponent implements TInputListener { private _mapPosition: MapPosition | null; private _transform: Transform3 | TReadOnlyProperty | null; private _keyboardDragDirection: KeyboardDragDirection; - private _positionProperty: TProperty | null; + private _positionProperty: Pick, 'value'> | null; private _dragVelocity: number; private _shiftDragVelocity: number; private _dragDelta: number; @@ -824,13 +824,13 @@ class KeyboardDragListener extends EnabledComponent implements TInputListener { // synchronize with model position if ( this._positionProperty ) { - let newPosition = this._positionProperty.get().plus( vectorDelta ); + let newPosition = this._positionProperty.value.plus( vectorDelta ); newPosition = this.mapModelPoint( newPosition ); // update the position if it is different - if ( !newPosition.equals( this._positionProperty.get() ) ) { - this._positionProperty.set( newPosition ); + if ( !newPosition.equals( this._positionProperty.value ) ) { + this._positionProperty.value = newPosition; } }