mirror of
https://github.com/Choices-js/Choices.git
synced 2026-03-14 14:45:47 +01:00
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. |
||
|---|---|---|
| .. | ||
| actions | ||
| components | ||
| lib | ||
| reducers | ||
| search | ||
| store | ||
| choices.test.ts | ||
| templates.test.ts | ||