Skip to content

Commit

Permalink
Improve Mover/Highlight experience. Reduce debounce timeout from 500 …
Browse files Browse the repository at this point in the history
…-> 250
  • Loading branch information
Jon Q committed Mar 18, 2020
1 parent aab3e71 commit c1cecda
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/block-editor/src/components/block-toolbar/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ import { useDispatch } from '@wordpress/data';
import { useState, useRef, useEffect, useCallback } from '@wordpress/element';

const { clearTimeout, setTimeout } = window;
const DEBOUNCE_TIMEOUT = 250;

/**
* Hook that creates a showMover state, as well as debounced show/hide callbacks
*/
export function useDebouncedShowMovers( {
ref,
isFocused,
debounceTimeout = 500,
debounceTimeout = DEBOUNCE_TIMEOUT,
onChange = noop,
} ) {
const [ showMovers, setShowMovers ] = useState( false );
Expand Down Expand Up @@ -87,7 +88,7 @@ export function useDebouncedShowMovers( {
*/
export function useShowMoversGestures( {
ref,
debounceTimeout = 500,
debounceTimeout = DEBOUNCE_TIMEOUT,
onChange = noop,
} ) {
const [ isFocused, setIsFocused ] = useState( false );
Expand Down

0 comments on commit c1cecda

Please sign in to comment.