Skip to content

EditableFileView

Official

Editable file view

Import:

import { EditableFileView } from 'obsidian';

Signature:

export class EditableFileView extends FileView

Extends: FileView

Constructor

new EditableFileView(leaf: WorkspaceLeaf)

Constructor.

To extract the constructor type, use ExtractConstructor<EditableFileView>.

Properties

Property Type Description
allowNoFile boolean Whether the view may be run without an attached file..
(Inherited from FileView)
file null | TFile The file that is currently being viewed.
(Inherited from FileView)
fileBeingRenamed null | TFile The file that is currently being renamed.
navigation boolean Whether the file view can be navigated.
(Inherited from FileView)

Methods

Method Returns Description
canAcceptExtension(extension) boolean Whether the file view can accept an extension.
(Inherited from FileView)
getDisplayText() string Get the display text for the file view.
(Inherited from FileView)
getState() Record<string, unknown> Get the state of the file view.
(Inherited from FileView)
getSyncViewState() unknown Get view state for sync plugin.
(Inherited from FileView)
loadFile(file) Promise<unknown> Loads the file with the onLoadFile function.
(Inherited from FileView)
onDelete(file) Promise<void> Updates the view if it contains the deleted file.
(Inherited from FileView)
onload() void Called when the file view is loaded.
(Inherited from FileView)
onLoadFile(file) Promise<void> Called when the file is loaded.
(Inherited from FileView)
onRename(file) Promise<void> Called when the file is renamed.
(Inherited from FileView)
onTitleBlur() Promise<void> Is called when the titleEl looses focus.

Event type: 'blur'.
onTitleChange(titleEl) void Is called when the titleEl is changed.

Event type: 'input'.
onTitleFocus() void Is called when the titleEl gains focus.

Event type: 'focus'.
onTitleKeydown(event) void Is called when the titleEl is focused and a keydown is triggered.

Event type: 'keydown'.
onTitlePaste(titleEl, event) void Is called when the titleEl is focused and a paste event is triggered.

Event type: 'paste'.
onUnloadFile(file) Promise<void> Called when the file is unloaded.
(Inherited from FileView)
receiveSyncState(view) void Receives sync state from another file view, opening the other view's file if it differs.
(Inherited from FileView)
renderBreadcrumbs() void Render the breadcrumb navigation for this file view.
(Inherited from FileView)
saveTitle(titleEl) Promise<void> Updates the file to match the updated title.
setState(state, result) Promise<void> Set the state of the file view.
(Inherited from FileView)
syncState(e) Promise<unknown> Synchronize the view state with the sync plugin.
(Inherited from FileView)

Links to this page: