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

Fix the "Get selection on input with "email" type" test in Firefox 68 #2071

Closed
AndreyBelym opened this issue Jul 11, 2019 · 2 comments
Closed
Assignees
Labels
Milestone

Comments

@AndreyBelym
Copy link
Contributor

AndreyBelym commented Jul 11, 2019

The Get selection on input with "email" type client test started failing after the Firefox 68 update.

Get selection on input with "email" type (2, 1, 3)

1. failed
    Expected: 13
    Result: 0
    Source:
        applyCurrent/<@http://localhost:2000/qunit-1.20.0.js:2145:13
        @http://localhost:2000/fixtures/sandbox/selection-test.js:785:5
        runTest@http://localhost:2000/qunit-1.20.0.js:903:28
        run@http://localhost:2000/qunit-1.20.0.js:888:4
        run/<@http://localhost:2000/qunit-1.20.0.js:1030:11
        process@http://localhost:2000/qunit-1.20.0.js:691:24
        begin@http://localhost:2000/qunit-1.20.0.js:673:2
        resumeProcessing/<@http://localhost:2000/qunit-1.20.0.js:733:4

2. failed
    Expected: 13
    Result: 0
    Source:
        applyCurrent/<@http://localhost:2000/qunit-1.20.0.js:2145:13
        @http://localhost:2000/fixtures/sandbox/selection-test.js:786:5
        runTest@http://localhost:2000/qunit-1.20.0.js:903:28
        run@http://localhost:2000/qunit-1.20.0.js:888:4
        run/<@http://localhost:2000/qunit-1.20.0.js:1030:11
        process@http://localhost:2000/qunit-1.20.0.js:691:24
        begin@http://localhost:2000/qunit-1.20.0.js:673:2
        resumeProcessing/<@http://localhost:2000/qunit-1.20.0.js:733:4

3. okay

Source: 
    @http://localhost:2000/fixtures/sandbox/selection-test.js:779:1 
    @http://localhost:2000/fixtures/sandbox/selection-test.js:908:7 
@Farfurix
Copy link
Contributor

Farfurix commented Jul 12, 2019

Native behavior. Sample page to illustrate the selectionStart and selectionEnd values based on the getSelection logic (input.type changing):

<html>
<head></head>
<body>
<script>
    // // inputText

    // var inputText = document.createElement('input');
    //
    // inputText.setAttribute('type', 'text');
    //
    // document.body.appendChild(inputText);
    //
    // inputText.value = '[email protected]';
    //
    // console.log('inputText.selectionStart =', inputText.selectionStart);
    // console.log('inputText.selectionEnd =', inputText.selectionEnd);

    //inputEmail

    var inputEmail = document.createElement('input');

    inputEmail.setAttribute('type', 'email');

    document.body.appendChild(inputEmail);

    inputEmail.value = '[email protected]';

    console.log('// inputEmail.type === "email"');
    console.log('inputEmail.selectionStart =', inputEmail.selectionStart);
    console.log('inputEmail.selectionEnd =', inputEmail.selectionEnd);

    // inputEmail.focus(); // Uncomment to see current selection position
    inputEmail.type = 'text';
    console.log('// inputEmail type changed to text');

    // // inputEmail selection changes after changing value
    // inputEmail.value = '';
    // inputEmail.value = '[email protected]';

    console.log('[FF 67: 13 (=== inputEmail.value.length)]; FF 68: 0] inputEmail.selectionStart =', inputEmail.selectionStart);
    console.log('[FF 67: 13 (=== inputEmail.value.length)]; FF 68: 0] inputEmail.selectionEnd =', inputEmail.selectionEnd);

    inputEmail.type = 'email';
    console.log('// inputEmail type restored to "email"');

    console.log('inputEmail.selectionStart =', inputEmail.selectionStart);
    console.log('inputEmail.selectionEnd =', inputEmail.selectionEnd);
</script>
</body>
</html>

Uncomment inputEmail.focus() result:
Firefox 67:
Capture
Firefox 68
Capture2

@lock
Copy link

lock bot commented Jul 27, 2019

This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow.

@lock lock bot added the STATE: Auto-locked Issues that were automatically locked by the Lock bot label Jul 27, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jul 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants