We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5d2feac commit 0630b63Copy full SHA for 0630b63
addon/display/placeholder.js
@@ -50,11 +50,12 @@
50
51
function onComposition(cm) {
52
setTimeout(function() {
53
- var empty = false, input = cm.getInputField()
54
- if (input.nodeName == "TEXTAREA")
55
- empty = !input.value
56
- else if (cm.lineCount() == 1)
57
- empty = !/[^\u200b]/.test(input.querySelector(".CodeMirror-line").textContent)
+ var empty = false
+ if (cm.lineCount() == 1) {
+ var input = cm.getInputField()
+ empty = input.nodeName == "TEXTAREA" ? !cm.getLine(0).length
+ : !/[^\u200b]/.test(input.querySelector(".CodeMirror-line").textContent)
58
+ }
59
if (empty) setPlaceholder(cm)
60
else clearPlaceholder(cm)
61
}, 20)
0 commit comments