fix(tags): refocus tag input after reject/un-reject too #151
@@ -21,14 +21,14 @@
|
|||||||
v-show="store.byCategory[cat] && store.byCategory[cat].length"
|
v-show="store.byCategory[cat] && store.byCategory[cat].length"
|
||||||
:label="labelFor(cat)" :items="store.byCategory[cat] || []"
|
:label="labelFor(cat)" :items="store.byCategory[cat] || []"
|
||||||
@accept="onAccept" @alias="onAlias" @remove-alias="onRemoveAlias"
|
@accept="onAccept" @alias="onAlias" @remove-alias="onRemoveAlias"
|
||||||
@dismiss="store.dismiss" @undismiss="store.undismiss"
|
@dismiss="onDismiss" @undismiss="onUndismiss"
|
||||||
/>
|
/>
|
||||||
<SuggestionsCategoryGroup
|
<SuggestionsCategoryGroup
|
||||||
v-if="store.byCategory.general && store.byCategory.general.length"
|
v-if="store.byCategory.general && store.byCategory.general.length"
|
||||||
label="General" :items="store.byCategory.general"
|
label="General" :items="store.byCategory.general"
|
||||||
collapsible :default-open="true"
|
collapsible :default-open="true"
|
||||||
@accept="onAccept" @alias="onAlias" @remove-alias="onRemoveAlias"
|
@accept="onAccept" @alias="onAlias" @remove-alias="onRemoveAlias"
|
||||||
@dismiss="store.dismiss" @undismiss="store.undismiss"
|
@dismiss="onDismiss" @undismiss="onUndismiss"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -57,9 +57,15 @@ const props = defineProps({
|
|||||||
// so the same panel refreshes the right surface. See TagPanel.
|
// so the same panel refreshes the right surface. See TagPanel.
|
||||||
host: { type: Object, default: null },
|
host: { type: Object, default: null },
|
||||||
})
|
})
|
||||||
// 'accepted' lets the parent return focus to the tag input after a suggestion is
|
// 'accepted'/'dismissed' let the parent return focus to the tag input after a
|
||||||
// applied (operator-asked 2026-06-08).
|
// suggestion is accepted OR rejected, so the operator keeps the keyboard flow on
|
||||||
const emit = defineEmits(['accepted'])
|
// the input without re-clicking (operator-asked 2026-06-08, 2026-06-30).
|
||||||
|
const emit = defineEmits(['accepted', 'dismissed'])
|
||||||
|
|
||||||
|
// Reject (✗) / un-reject (↶): apply the store change, then signal the parent to
|
||||||
|
// re-focus the tag input — same return-to-input behaviour as accept.
|
||||||
|
function onDismiss (s) { store.dismiss(s); emit('dismissed') }
|
||||||
|
function onUndismiss (s) { store.undismiss(s); emit('dismissed') }
|
||||||
const store = useSuggestionsStore()
|
const store = useSuggestionsStore()
|
||||||
const modalStore = useModalStore()
|
const modalStore = useModalStore()
|
||||||
const host = props.host || modalStore
|
const host = props.host || modalStore
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
:image-id="host.currentImageId"
|
:image-id="host.currentImageId"
|
||||||
:host="host"
|
:host="host"
|
||||||
@accepted="focusTagInput"
|
@accepted="focusTagInput"
|
||||||
|
@dismissed="focusTagInput"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- @after-leave: when either dialog finishes closing (apply OR cancel),
|
<!-- @after-leave: when either dialog finishes closing (apply OR cancel),
|
||||||
|
|||||||
Reference in New Issue
Block a user