yoast-components icon indicating copy to clipboard operation
yoast-components copied to clipboard

Slug field unresponsive when typing

Open afercia opened this issue 7 years ago • 3 comments

Switch to the feature/react-snippet-editor branch

  • yarn start and go to localhost:3333
  • click on the Slug field and type something
  • the responsiveness when typing is extremely slow with any browser and most importantly some typed characters are completely missing
  • also: try to press and hold backspace: it deletes just one character: expected: it should progressively delete all characters from right to left

In the screenshot below: using Chrome on maOS I've typed hello-my-post-title and here's what I get:

screen shot 2018-06-08 at 12 30 21

afercia avatar Jun 08 '18 10:06 afercia

I tested it in both the standalone and in wordpress-seo context.

On the standalone it is an awful experience. but for some reason, it does work fine in wordpress-seo context. This is high on the priority list, but not as high as some other issues.

boblinthorst avatar Jun 08 '18 11:06 boblinthorst

Hm right. I see the standalone example uses a different callback for onChange:

this.onChangedData = debounce( this.onChangedData.bind( this ), 150 );

which is completely different from the actual one used in the plugin. It's also debounced, hence the mess while typing. We should really keep the standalone example as close as possible to the real usage, to avoid this kind of misunderstanding (and wasted debugging time).

afercia avatar Jun 08 '18 15:06 afercia

Just noticed with Safari the slow response is noticeable also in the wordpress-seo context, not so slow as in the standalone version, but still noticeable.

afercia avatar Jun 11 '18 10:06 afercia