@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.
- package/esm2020/lib/input/mentions-input/mentions-input.component.mjs +9 -3
- package/fesm2015/rivet-health-design-system.mjs +8 -2
- package/fesm2015/rivet-health-design-system.mjs.map +1 -1
- package/fesm2020/rivet-health-design-system.mjs +8 -2
- package/fesm2020/rivet-health-design-system.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -4330,9 +4330,15 @@ class MentionsInputComponent {
|
|
|
4330
4330
|
const newRange = window.getSelection()?.getRangeAt(0);
|
|
4331
4331
|
if (newRange) {
|
|
4332
4332
|
newRange.insertNode(mentionSpan);
|
|
4333
|
-
//
|
|
4333
|
+
//collapse range to position cursor after mention
|
|
4334
4334
|
newRange.setStartAfter(mentionSpan);
|
|
4335
|
-
newRange.
|
|
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);
|