-
Notifications
You must be signed in to change notification settings - Fork 675
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
Should type in contenteditable div even if it has invisible child with contenteditable=false (#2205) #2222
Merged
Merged
Should type in contenteditable div even if it has invisible child with contenteditable=false (#2205) #2222
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
3ea208a
[WIP]Should type in contenteditable div even if it has invisible chil…
AlexKamaev c2f316c
add one more test case
AlexKamaev aef9b68
fix tests on safari osx
AlexKamaev d474b5d
fix changes after request
AlexKamaev 36d29f7
fixes after review
AlexKamaev 2524cdc
refactoring
AlexKamaev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 101 additions & 0 deletions
101
test/functional/fixtures/regression/gh-2205/pages/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Title</title> | ||
<style> | ||
#editor1.focused .placeholder { | ||
display: none; | ||
} | ||
|
||
#editor2.focused .placeholder { | ||
visibility: hidden; | ||
} | ||
|
||
#editor3 .placeholder { | ||
display: none; | ||
} | ||
|
||
.placeholder { | ||
color: #aaa; | ||
font-style: italic; | ||
height: 0; | ||
pointer-events: none; | ||
} | ||
|
||
.editor { | ||
padding: 4px 8px 4px 14px; | ||
line-height: 1.2; | ||
outline: none; | ||
} | ||
|
||
.editor { | ||
word-wrap: break-word; | ||
white-space: pre-wrap; | ||
font-variant-ligatures: none; | ||
} | ||
|
||
.editor { | ||
position: relative; | ||
} | ||
|
||
.outer-editor { | ||
background: white; | ||
color: black; | ||
background-clip: padding-box; | ||
border-radius: 4px; | ||
border: 2px solid rgba(0, 0, 0, 0.2); | ||
padding: 5px 0; | ||
margin-bottom: 23px; | ||
} | ||
|
||
.outer-editor { | ||
border: 1px solid grey; | ||
} | ||
|
||
.editor p:first-child { | ||
margin-top: 10px; | ||
} | ||
|
||
.editor p { | ||
margin-bottom: 1em; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
|
||
<h2>Display: none</h2> | ||
<div class="outer-editor"> | ||
<div id="editor1" contenteditable="true" class="editor" | ||
onmousedown="event.currentTarget.className += ' focused'"></div> | ||
</div> | ||
|
||
<h2>Visibility: hidden</h2> | ||
<div class="outer-editor"> | ||
<div id="editor2" contenteditable="true" class="editor" | ||
onmousedown="event.currentTarget.className += ' focused'"></div> | ||
</div> | ||
|
||
<h2>Two hidden divs inside</h2> | ||
<div class="outer-editor"> | ||
<div id="editor3" contenteditable="true" class="editor"><div><div class="placeholder"></div><div class="placeholder">test</div></div></div> | ||
</div> | ||
|
||
<div id="placeholder1" contenteditable="false" class="placeholder">Type here...</div> | ||
<div id="placeholder2" contenteditable="false" class="placeholder">Type here...</div> | ||
|
||
<script type="text/javascript"> | ||
function createEditor (editor, placeholder) { | ||
var paragraph = document.createElement('p'); | ||
var lineBreak = document.createElement('br'); | ||
|
||
editor.appendChild(paragraph); | ||
paragraph.appendChild(placeholder); | ||
paragraph.appendChild(lineBreak); | ||
} | ||
|
||
createEditor(document.getElementById('editor1'), document.getElementById('placeholder1')); | ||
createEditor(document.getElementById('editor2'), document.getElementById('placeholder2')); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
describe('[Regression](GH-2205)', function () { | ||
it('Should type in div if it has an invisible child with contententeditable=false', function () { | ||
return runTests('testcafe-fixtures/index.js'); | ||
}); | ||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add
includeDescendants
arg tohasSelectableChildren
method and use it here