@rivet-health/design-system 32.2.0 → 32.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4330,9 +4330,15 @@ class MentionsInputComponent {
4330
4330
  const newRange = window.getSelection()?.getRangeAt(0);
4331
4331
  if (newRange) {
4332
4332
  newRange.insertNode(mentionSpan);
4333
- //Set the range start and end to the same location (rendering the cursor in the right position)
4333
+ //collapse range to position cursor after mention
4334
4334
  newRange.setStartAfter(mentionSpan);
4335
- newRange.setEndAfter(mentionSpan);
4335
+ newRange.collapse(true);
4336
+ //Add a space after the mention
4337
+ const spaceNode = document.createTextNode('\u00A0');
4338
+ newRange.insertNode(spaceNode);
4339
+ //Position cursor after the space
4340
+ newRange.setStartAfter(spaceNode);
4341
+ newRange.collapse(true);
4336
4342
  selection.removeAllRanges();
4337
4343
  //Apply this range to the DOM
4338
4344
  selection.addRange(newRange);