I know FireFox can deal with execCommand
pretty well but this time I think I encountered a bug.
But maybe I'm just overlooking something.
I do have a textarea
where I am executing insertText
which just works fine as long as I am leaving the textarea
or writing into it. When I want to execute a second time, it is written in text but not in value. Is it because of insertText
?
Here is my example:
<!doctype html>
<html>
<head>
<title>Test</title>
</head>
<body>
<textarea designMode="on" id="textarea"></textarea>
<a href="#" onclick="document.getElementById('textarea').focus(); document.execCommand('insertText', false, 'Text'); return false;">Insert text</a>
<a href="#" onclick="document.getElementById('textarea').value = ''; return false;">Reset</a>
</body>
</html>
Does anyone have a solution for that? Unfortunately it isn't possible to use a div contenteditable
.
Tested in FireFox 41.0.2 with no Add-Ons enabled.
The command document.execCommand('insertText', false, 'Text')
doesn't work in Firefox for textarea
.
See bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1220696
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With