@magicx-eng/ai-autocomplete-angular 0.7.1 → 0.7.2
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/internal/editor-host/editor-host.directive.mjs +9 -2
- package/fesm2015/magicx-eng-ai-autocomplete-angular.mjs +8 -1
- package/fesm2015/magicx-eng-ai-autocomplete-angular.mjs.map +1 -1
- package/fesm2020/magicx-eng-ai-autocomplete-angular.mjs +8 -1
- package/fesm2020/magicx-eng-ai-autocomplete-angular.mjs.map +1 -1
- package/lib/internal/editor-host/editor-host.directive.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1138,7 +1138,14 @@ class AIAutocompleteEditorHostDirective {
|
|
|
1138
1138
|
return;
|
|
1139
1139
|
const anchor = sel.anchorNode;
|
|
1140
1140
|
const startEl = anchor.nodeType === Node.ELEMENT_NODE ? anchor : anchor.parentElement;
|
|
1141
|
-
|
|
1141
|
+
// Only a COLLAPSED selection means "the caret landed in a chip". A
|
|
1142
|
+
// range selection (Cmd+A, shift-arrow, drag) anchors at its start,
|
|
1143
|
+
// which lands inside the first `<strong>` whenever the input begins
|
|
1144
|
+
// with a chip — starting re-edit there parks the caret on that chip
|
|
1145
|
+
// and destroys the user's selection.
|
|
1146
|
+
const strong = sel.isCollapsed
|
|
1147
|
+
? startEl?.closest('strong[data-seg="completed"][data-param-id]')
|
|
1148
|
+
: null;
|
|
1142
1149
|
// `DOMStringMap` is an index signature; bracket notation is required
|
|
1143
1150
|
// by `noPropertyAccessFromIndexSignature`.
|
|
1144
1151
|
const enclosing = strong?.dataset["paramId"] ?? null;
|