Choices/test/scripts/components
terminalchai e467bc0de0 refactor(input): replace Intl.Segmenter with DOM-based width measurement
Remove isWideChar() and getStringWidth() entirely. Instead, measure text
width by inserting a hidden <span> that inherits the input element's CSS
classes, setting innerText, and reading clientWidth. Dividing by the span's
own 1ch pixel value converts the measurement back into ch units.

This approach correctly handles CJK, Hangul, fullwidth forms, emoji, and
any font without hard-coded code-point ranges or reliance on Intl.Segmenter.

Remove unit tests for setWidth() that depended on jsdom layout measurement
(jsdom has no layout engine). Width behaviour is verified by e2e tests.

Addresses Xon's review feedback on PR #1384.
2026-03-11 00:26:29 +05:30
..
container.test.ts Fix dropdown flip logic did not consider verticality of both sides of the dropdown (ref: https://github.com/formio/Choices/pull/2) 2024-08-26 02:36:55 +08:00
dropdown.test.ts linting fixes 2024-08-26 02:47:22 +08:00
input.test.ts refactor(input): replace Intl.Segmenter with DOM-based width measurement 2026-03-11 00:26:29 +05:30
list.test.ts Cleanup unused import 2024-08-27 20:50:47 +08:00
wrapped-element.test.ts It isn't the 1990s where 1080p monitors were exotic 2024-08-14 19:53:48 +08:00
wrapped-input.test.ts It isn't the 1990s where 1080p monitors were exotic 2024-08-14 19:53:48 +08:00
wrapped-select.test.ts Support <option> label attribute 2025-03-14 09:36:07 +08:00