Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Fix DOMObserver mutation data for IE #2285

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/component/handlers/composition/DOMObserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ class DOMObserver {
// These events are also followed by a `childList`, which is the one
// we are able to retrieve the offsetKey and apply the '' text.
if (target.textContent !== '') {
// IE 11 considers the enter keypress that concludes the composition
// as an input char. This strips that newline character so the draft
// state does not receive spurious newlines.
if (USE_CHAR_DATA) {
return target.textContent.replace('\n', '');
}
return target.textContent;
}
} else if (type === 'childList') {
Expand Down