Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ux): response editor #1220

Merged
merged 8 commits into from
May 24, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: change focus logic
  • Loading branch information
ssiyad committed May 24, 2023
commit 45b20c92ba18f044dd9bd26acc43878eca34ea99
15 changes: 5 additions & 10 deletions desk/src/pages/desk/ticket/editor/ResponseEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<div
v-else
class="flex h-8 w-full cursor-pointer select-none items-center rounded-lg border border-gray-300 px-2.5 text-base text-gray-500"
@click="expand"
@click="editor.isExpanded = true"
>
{{ placeholder }}
</div>
Expand Down Expand Up @@ -58,15 +58,10 @@ const mentions = computed(() =>
}))
);

function expand() {
editor.isExpanded = true;

setTimeout(() => {
editor.tiptap?.commands.focus();
}, 300);
}

watch(editorRef, (e) => (editor.tiptap = e.editor));
watch(editorRef, (e) => {
editor.tiptap = e.editor;
if (editor.tiptap) editor.tiptap?.commands.focus();
});
onUnmounted(() => (editor.isExpanded = false));
</script>

Expand Down