mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-26 11:34:58 +02:00
UBERF-5626: set autofocus end on message edit (#4784)
Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
@@ -17,14 +17,7 @@
|
||||
import { Attachment } from '@hcengineering/attachment'
|
||||
import { Account, Class, Doc, generateId, IdMap, Ref, Space, toIdMap } from '@hcengineering/core'
|
||||
import { IntlString, setPlatformStatus, unknownError, Asset } from '@hcengineering/platform'
|
||||
import {
|
||||
createQuery,
|
||||
DraftController,
|
||||
draftsStore,
|
||||
getClient,
|
||||
getFileUrl,
|
||||
getImageSize
|
||||
} from '@hcengineering/presentation'
|
||||
import { createQuery, DraftController, draftsStore, getClient } from '@hcengineering/presentation'
|
||||
import textEditor, { AttachIcon, type RefAction, ReferenceInput } from '@hcengineering/text-editor'
|
||||
import { Loading, type AnySvelteComponent } from '@hcengineering/ui'
|
||||
import { deleteFile, getAttachmentMetadata, uploadFile } from '../utils'
|
||||
@@ -43,6 +36,7 @@
|
||||
export let attachments: IdMap<Attachment> = new Map()
|
||||
export let loading = false
|
||||
export let focusIndex: number = -1
|
||||
export let autofocus = false
|
||||
export function submit (): void {
|
||||
refInput.submit()
|
||||
}
|
||||
@@ -296,6 +290,7 @@
|
||||
{labelSend}
|
||||
{showSend}
|
||||
{showActions}
|
||||
autofocus={autofocus ? 'end' : false}
|
||||
loading={loading || progress}
|
||||
{boundary}
|
||||
extraActions={[
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
export let boundary: HTMLElement | undefined = undefined
|
||||
export let loading = false
|
||||
export let collection: string = 'comments'
|
||||
export let autofocus = false
|
||||
|
||||
type MessageDraft = Pick<ChatMessage, '_id' | 'message' | 'attachments'>
|
||||
|
||||
@@ -186,6 +187,7 @@
|
||||
bind:objectId={_id}
|
||||
{shouldSaveDraft}
|
||||
{boundary}
|
||||
{autofocus}
|
||||
on:message={onMessage}
|
||||
on:update={onUpdate}
|
||||
on:focus
|
||||
|
||||
@@ -174,7 +174,7 @@
|
||||
{isSelected}
|
||||
{shouldScroll}
|
||||
{embedded}
|
||||
{withActions}
|
||||
withActions={withActions && !isEditing}
|
||||
actions={additionalActions}
|
||||
{showEmbedded}
|
||||
{hideFooter}
|
||||
@@ -213,6 +213,8 @@
|
||||
bind:this={refInput}
|
||||
chatMessage={value}
|
||||
shouldSaveDraft={false}
|
||||
focusIndex={1000}
|
||||
autofocus
|
||||
{object}
|
||||
on:submit={() => {
|
||||
isEditing = false
|
||||
|
||||
Reference in New Issue
Block a user