Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to click on button if it is hidden by fixed div if the div is too large #2450

Closed
AlexKamaev opened this issue May 23, 2018 · 3 comments
Assignees
Labels
STATE: Auto-locked An issue has been automatically locked by the Lock bot. SYSTEM: automations TYPE: bug The described behavior is considered as wrong (bug).
Milestone

Comments

@AlexKamaev
Copy link
Contributor

Are you requesting a feature or reporting a bug?

a bug

What is the current behavior?

unable to click on button if it is hidden by fixed div if the div is too large

What is the expected behavior?

should click on it

@AlexKamaev AlexKamaev added SYSTEM: automations TYPE: bug The described behavior is considered as wrong (bug). labels May 23, 2018
@AlexKamaev
Copy link
Contributor Author

AlexKamaev commented May 23, 2018

page

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        #fixedTop {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 300px;
        }

        #fixedTop div {
            width: 100%;
            height: 100%;
            background-color: red;
        }

        #fixedLeft {
            position: fixed;
            top: 0;
            bottom: 0;
            left: 0;
            background-color: yellow;
            width: 400px;
        }

        #button1 {
            margin-top: 500px;
            margin-left: 1000px
        }
    </style>
</head>
<body>
    <div style="height: 9000px; width: 9000px;">
        <button id="button1" onclick="onClick('button1', event)">Click me</button>
        <div id="result"></div>
    </div>
    <div id="fixedLeft"></div>
    <div id="fixedTop" onclick="onClick('fixedTop', event)">
        <div>
            <button id="button2" onclick="onClick('button2', event)">Click me</button>
        </div>
    </div>
    <script type="text/javascript">

        function onClick (text, event) {
            document.getElementById('result').innerHTML += text + ' ';

            event.stopPropagation()
        }

        setTimeout(function () {
            window.scrollTo(5000, 5000);
        });
    </script>
</body>
</html>

test

import { Selector } from 'testcafe';

fixture `gh-1057 - fixed by hidden ancestor`
    .page `http://127.0.0.1:8080/hiddenByFixedAncestor.html`;

const button1  = Selector('#button1');
const button2  = Selector('#button2');
const fixedTop = Selector('#fixedTop');
const result   = Selector('#result');

test('click on elements', async t => {
    await t
        .resizeWindow(900, 570)
        .click(button1) <------------ button1 is hidden always
});

@AlexKamaev
Copy link
Contributor Author

see tests to #1057
remove skip: 'edge' after fixing this

AlexKamaev added a commit to AlexKamaev/testcafe that referenced this issue May 23, 2018
AlexKamaev added a commit that referenced this issue May 24, 2018
* should scroll to element if it is hidden by fixed (closes #2391)

* fix lint

* refix

* merge tests

* skip edge because of #2450
@AndreyBelym AndreyBelym added this to Needs triage in Bugs triage Jul 13, 2018
@AndreyBelym AndreyBelym moved this from Needs triage to Automations in Bugs triage Jul 13, 2018
@AndreyBelym AndreyBelym moved this from Action Simulation to Scrolling in Bugs triage Jul 13, 2018
@AndreyBelym AndreyBelym added this to Candidates in Sprint #14 via automation Jul 16, 2018
@AndreyBelym AndreyBelym moved this from Candidates to To do: Automation Bugs in Sprint #14 Jul 16, 2018
@AndreyBelym AndreyBelym moved this from To do: Automation Bugs to Candidates in Sprint #14 Jul 16, 2018
@AndreyBelym AndreyBelym moved this from Candidates to To do: Automation Bugs in Sprint #14 Jul 16, 2018
@AndreyBelym AndreyBelym added this to the Sprint #14 milestone Jul 16, 2018
@AlexKamaev AlexKamaev self-assigned this Jul 26, 2018
@AndreyBelym AndreyBelym modified the milestones: Sprint #14, Sprint #15 Jul 30, 2018
Bugs triage automation moved this from Scrolling to Closed Aug 8, 2018
Sprint #14 automation moved this from To do: Automation Bugs to Done Aug 8, 2018
@lock
Copy link

lock bot commented Mar 28, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs or feature requests. For TestCafe API, usage and configuration inquiries, we recommend asking them on StackOverflow.

@lock lock bot added the STATE: Auto-locked An issue has been automatically locked by the Lock bot. label Mar 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 28, 2019
kirovboris pushed a commit to kirovboris/testcafe-phoenix that referenced this issue Dec 18, 2019
…ress#2450) (DevExpress#2673)

* modify scrolling behavior is target is hidden by fixed (closes DevExpress#2450)

* minor changes after review

* fix review

* fix round issues
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
STATE: Auto-locked An issue has been automatically locked by the Lock bot. SYSTEM: automations TYPE: bug The described behavior is considered as wrong (bug).
Projects
Bugs triage
  
Closed
Sprint #14
  
Done
Development

No branches or pull requests

2 participants