Commit f658585
[fix][CLNP-7811] Treat whitespace-only input as empty for typing state
The previous empty-check used `getTextContentWithoutZeroWidthSpace(...) ===
''` (no trim), while the same handler's `setIsInput` call used
`hasTextContentWithoutZeroWidthSpace` (trim-aware). This split meant a user
who typed text and then deleted it down to whitespace/newlines saw the send
button disappear (functionally empty UI) but the typing indicator stayed
visible to peers until the SDK server-side timeout expired.
Use `hasTextContentWithoutZeroWidthSpace` for both checks so typing state
follows the same trim semantics as the send-button state. The DOM read is
also collapsed into a single call.
Add 2 tests:
- onStopTyping fires when input becomes whitespace-only after typing
- onStartTyping does not fire on whitespace-only input
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 770af64 commit f658585
2 files changed
Lines changed: 33 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
321 | 348 | | |
322 | 349 | | |
323 | 350 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
526 | 526 | | |
527 | 527 | | |
528 | 528 | | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
| 529 | + | |
| 530 | + | |
536 | 531 | | |
537 | 532 | | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
538 | 536 | | |
539 | | - | |
| 537 | + | |
540 | 538 | | |
541 | 539 | | |
542 | 540 | | |
| |||
0 commit comments