Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /html/semantics/forms/constraints/input-maxlength-emoji.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>Tests pasting an emoji in a text field with a maxlength attribute</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<input id="target" type="text" maxlength="10" />
<script>
test(function() {
let target = document.getElementById("target");
target.focus();
document.execCommand("InsertHTML", false, "๐จโ๐ฉโ๐งโ๐ฆ");
assert_equals(target.value, "๐จโ๐ฉโ๐งโ");
}, "Emoji gets truncated due to maxlength attribute");
</script>