fix: pwa sticky issue comment (#5419)
This commit is contained in:
parent
700f3ee823
commit
9065932c86
1 changed files with 6 additions and 1 deletions
|
|
@ -7,9 +7,10 @@ import { LiteTextEditor } from "@/components/editor/lite-text-editor/lite-text-e
|
||||||
// constants
|
// constants
|
||||||
import { EIssueCommentAccessSpecifier } from "@/constants/issue";
|
import { EIssueCommentAccessSpecifier } from "@/constants/issue";
|
||||||
// helpers
|
// helpers
|
||||||
|
import { cn } from "@/helpers/common.helper";
|
||||||
import { isEmptyHtmlString } from "@/helpers/string.helper";
|
import { isEmptyHtmlString } from "@/helpers/string.helper";
|
||||||
// hooks
|
// hooks
|
||||||
import { useWorkspace } from "@/hooks/store";
|
import { useIssueDetail, useWorkspace } from "@/hooks/store";
|
||||||
// editor
|
// editor
|
||||||
import { TActivityOperations } from "../root";
|
import { TActivityOperations } from "../root";
|
||||||
|
|
||||||
|
|
@ -27,6 +28,7 @@ export const IssueCommentCreate: FC<TIssueCommentCreate> = (props) => {
|
||||||
const editorRef = useRef<any>(null);
|
const editorRef = useRef<any>(null);
|
||||||
// store hooks
|
// store hooks
|
||||||
const workspaceStore = useWorkspace();
|
const workspaceStore = useWorkspace();
|
||||||
|
const { peekIssue } = useIssueDetail();
|
||||||
// derived values
|
// derived values
|
||||||
const workspaceId = workspaceStore.getWorkspaceBySlug(workspaceSlug as string)?.id as string;
|
const workspaceId = workspaceStore.getWorkspaceBySlug(workspaceSlug as string)?.id as string;
|
||||||
// form info
|
// form info
|
||||||
|
|
@ -58,6 +60,9 @@ export const IssueCommentCreate: FC<TIssueCommentCreate> = (props) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
className={cn("sticky bottom-0 z-10 bg-custom-background-100 sm:static", {
|
||||||
|
"-bottom-5": !peekIssue,
|
||||||
|
})}
|
||||||
onKeyDown={(e) => {
|
onKeyDown={(e) => {
|
||||||
if (e.key === "Enter" && !e.shiftKey && !e.ctrlKey && !e.metaKey && !isEmpty && !isSubmitting)
|
if (e.key === "Enter" && !e.shiftKey && !e.ctrlKey && !e.metaKey && !isEmpty && !isSubmitting)
|
||||||
handleSubmit(onSubmit)(e);
|
handleSubmit(onSubmit)(e);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue