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.

For inline elements that wrap lines, the click funtion misses when the first child element has no width

See original GitHub issue

Current behavior:

For inline elements that wrap lines, sometimes the center of the bounding rect is not actually part of the element. So the first client rect is used in order to ensure that the click function does not miss when it attempts to click the element. In rare cases, this element may actually have no width, which results in a missed click as well.

Desired behavior:

The click function should always properly click the element.

Test code to reproduce

<div style="width: 30px; line-height: 2;">
  <a href="#" id="overflow-link-width">
    <i style="display: inline-block;"></i>
    foofoofoofoofoo bar
  </a>
</div>
cy.get('#overflow-link-width').click()

Versions

4.5.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
panzarinocommented, May 14, 2020

@jennifer-shehane Yeah that’s the issue, Brian had indicated I had to open a new issue but I guess I was mistaken. I can close this issue and link the PR to that one.

0reactions
cypress-bot[bot]commented, Jun 8, 2020

Released in 4.8.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to Cypress v4.8.0, please open a new issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Inline elements - HTML: HyperText Markup Language | MDN
Inline elements are those which only occupy the space bounded by the tags defining the element, instead of breaking the flow of the...
Read more >
Why is this inline-block element pushed downward?
And I know that its overflow:hidden; which is causing it but not sure that why its pushing that div downward. body { width:...
Read more >
Fighting the Space Between Inline Block Elements | CSS-Tricks
A series of inline-block elements with "normal" HTML formatting result in spaces between them when set on the same line.
Read more >
How to prevent inline-block divs from wrapping - GeeksforGeeks
The display: inline-block; is a layout property in CSS that does not add a line break after the element. As a result, the...
Read more >
Docs • Svelte
The value attribute of an input element or its children option elements must not be set with spread attributes when using bind:group or...
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