question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

selectall / unselect regressions in 3.5.0, 3.6

See original GitHub issue

Some regressions were introduced in 3.5 in type() behavior when interacting with selection (selectall / unselect).

Current behavior:

The issue happens in a rich text editor where we are making a text bold by triggering:

  • {selectall} to select the typed text
  • {ctrl}B one time to start
  • unselecting by triggering {rightarrow}.
  • {ctrl}B a second time to stop

It seems:

  • the content is not unselected by triggering {rightarrow}.
  • the {ctrl} is ignored, only B is triggered

Steps to reproduce: (app code and test code)

In a rich text editor supporting this command.

  • Type: Hello{selectall}{ctrl}B{rightarrow}{ctrl}B world!
  • Desired behavior < 3.5: Hello World !
  • Current behavior >= 3.5: B World!

Work in progress, currently trying to generate a minimum reproduction.

Sources

Versions

Introduced in Cypress 3.5, still happening in 3.6. Linux / Mac OS.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kucebcommented, Nov 13, 2019

@Betree so in 3.4.1 if you have two of the same modifiers in a key string, we simply ignore the second one, since we treat it as still being held down. In 3.5.0+ we send a second keydown, which is causing the bug. If you remove the second ctrl from your type string, it should fix the issue. I’ll open another PR to fix this and revert to ❤️.5.0 behavior, but this does show how our .type API is confusing for users. (notice in the 3.4.1 screenshot how the ctrl modifier is held down after the first press, and there is no second ctrl keydown)

We should probably implement a way to type one modifier key combination + release without having to break up into multiple type commands, something like: cy.type('{ctrl+b}hello{ctrl+b}world')

1reaction
Betreecommented, Nov 13, 2019

Hi @Bkucera, I’m working with @znarf on Open Collective.

We don’t preventDefault in our code, but the library we’re using - react-quill - may.

Here’s a screenshot of the logs in console:

  • With 3.4.1

image

  • With 3.6.1

image


I’ve been able to make it work on 3.6.1 by splitting in multiple cy.type:

    cy.get('[data-cy="HTMLEditor"] .ql-editor').type('Hello');
    cy.get('[data-cy="HTMLEditor"] .ql-editor').type('{selectall}');
    cy.get('[data-cy="HTMLEditor"] .ql-editor').type('{ctrl}B');
    cy.get('[data-cy="HTMLEditor"] .ql-editor').type('{rightarrow}');
    cy.get('[data-cy="HTMLEditor"] .ql-editor').type('{ctrl}B');
    cy.get('[data-cy="HTMLEditor"] .ql-editor').type(' world!');
Read more comments on GitHub >

github_iconTop Results From Across the Web

37606 – EDITING, TABLES: Edit > Select All doesn't work on a ...
Type Ctrl+A (or on the menu: Edit > Select All) and it will only select the table (first the cell, and then the...
Read more >
Changelog - Cypress Documentation
We fixed a regression in 3.5.0 where Cypress would crash on Windows when trying to pass a url through --config or --env command...
Read more >
Versions - MulgaSoft
Version 3.6.5: Add eval-expression (M-:) to set/show certain internal variables dynamically; If the internal variable `kill-whole-line' is non-`nil', ...
Read more >
Maven error "Failure to transfer..." - eclipse - Stack Overflow
Remove all your failed downloads: find ~/.m2 -name "*.lastUpdated" -exec grep -q "Could not transfer" {} \; -print -exec rm {} \;. For...
Read more >
JupyterLab Changelog — JupyterLab 3.6.0b0 documentation
Bugs fixed¶ · Set isUntitled to false on document path changes #13268 (@fcollonval) · Remove some unused CSS styles and fix icon alignment...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found