fix: include more search results in linking autocomplete menu
This commit is contained in:
@@ -9,7 +9,6 @@ import { ListableContentItem } from '../Types/ListableContentItem'
|
||||
import { DailyItemsDay } from './DailyItemsDaySection'
|
||||
import { ListItemTitle } from '../ListItemTitle'
|
||||
import { EmptyPlaceholderBars } from './EmptyPlaceholderBars'
|
||||
import { isMobileScreen } from '@/Utils'
|
||||
|
||||
type DaySquareProps = {
|
||||
day: number
|
||||
@@ -73,7 +72,7 @@ export const DailyItemCell = forwardRef(
|
||||
{!item && (
|
||||
<div className="w-full">
|
||||
<div className="break-word mr-2 font-semibold">{formatDateAndTimeForNote(section.date, false)}</div>
|
||||
<EmptyPlaceholderBars rows={isMobileScreen() ? 2 : 4} />
|
||||
<EmptyPlaceholderBars rows={1} />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -95,7 +95,7 @@ class NoteView extends AbstractComponent<NoteViewProps, State> {
|
||||
private protectionTimeoutId: ReturnType<typeof setTimeout> | null = null
|
||||
private noteViewElementRef: RefObject<HTMLDivElement>
|
||||
private editorContentRef: RefObject<HTMLDivElement>
|
||||
private plainEditorRef?: RefObject<PlainEditorInterface>
|
||||
private plainEditorRef?: PlainEditorInterface
|
||||
|
||||
constructor(props: NoteViewProps) {
|
||||
super(props, props.application)
|
||||
@@ -231,6 +231,18 @@ class NoteView extends AbstractComponent<NoteViewProps, State> {
|
||||
}
|
||||
}
|
||||
|
||||
setPlainEditorRef = (ref: PlainEditorInterface | undefined) => {
|
||||
this.plainEditorRef = ref || undefined
|
||||
|
||||
if (!this.plainEditorRef) {
|
||||
return
|
||||
}
|
||||
|
||||
if (this.controller.isTemplateNote && this.controller.templateNoteOptions?.autofocusBehavior === 'editor') {
|
||||
this.plainEditorRef.focus()
|
||||
}
|
||||
}
|
||||
|
||||
override componentDidUpdate(_prevProps: NoteViewProps, prevState: State): void {
|
||||
if (
|
||||
this.state.showProtectedWarning != undefined &&
|
||||
@@ -569,7 +581,7 @@ class NoteView extends AbstractComponent<NoteViewProps, State> {
|
||||
}
|
||||
|
||||
currentTarget.blur()
|
||||
this.plainEditorRef?.current?.focus()
|
||||
this.plainEditorRef?.focus()
|
||||
}
|
||||
|
||||
onTitleChange: ChangeEventHandler<HTMLInputElement> = ({ currentTarget }) => {
|
||||
@@ -944,7 +956,7 @@ class NoteView extends AbstractComponent<NoteViewProps, State> {
|
||||
<PlainEditor
|
||||
application={this.application}
|
||||
spellcheck={this.state.spellcheck}
|
||||
ref={this.plainEditorRef}
|
||||
ref={(ref) => this.setPlainEditorRef(ref || undefined)}
|
||||
controller={this.controller}
|
||||
locked={this.state.noteLocked}
|
||||
onFocus={this.onPlainFocus}
|
||||
|
||||
@@ -33,7 +33,7 @@ export type PlainEditorInterface = {
|
||||
}
|
||||
|
||||
export const PlainEditor = forwardRef<PlainEditorInterface, Props>(
|
||||
({ application, spellcheck, controller, locked, onFocus, onBlur }: Props, ref) => {
|
||||
({ application, spellcheck, controller, locked, onFocus, onBlur }, ref) => {
|
||||
const [editorText, setEditorText] = useState<string | undefined>()
|
||||
const [textareaUnloading, setTextareaUnloading] = useState(false)
|
||||
const [lineHeight, setLineHeight] = useState<EditorLineHeight | undefined>()
|
||||
@@ -239,7 +239,7 @@ export const PlainEditor = forwardRef<PlainEditorInterface, Props>(
|
||||
onFocus={onContentFocus}
|
||||
onBlur={onContentBlur}
|
||||
readOnly={locked}
|
||||
ref={(ref) => ref && onRef(ref)}
|
||||
ref={onRef}
|
||||
spellCheck={spellcheck}
|
||||
value={editorText}
|
||||
className={classNames(
|
||||
|
||||
Reference in New Issue
Block a user