Skip to content

Commit

Permalink
fix: make sure the editor always has the right height
Browse files Browse the repository at this point in the history
fixes #38
  • Loading branch information
danielo515 committed Sep 15, 2023
1 parent 40f1a87 commit 53f10b3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/sync-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ permissions:

jobs:
sync-versions:
# if: "${{ github.event.label.name == 'autorelease: pending' }}"
# if: "${{ contains(github.event.pull_request.labels.*.name, 'autorelease: pending') }}"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
7 changes: 4 additions & 3 deletions src/views/EditFormView.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import ModalFormPlugin from "main";
import { ItemView, type ViewStateResult, WorkspaceLeaf } from "obsidian";
import type { FormDefinition, AllFieldTypes } from "../core/formDefinition";
import type { FormDefinition, EditableFormDefinition } from "../core/formDefinition";
import FormEditor from './FormBuilder.svelte'

export const EDIT_FORM_VIEW = "modal-form-edit-form-view";

function parseState(maybeState: unknown): maybeState is FormDefinition {
function parseState(maybeState: unknown): maybeState is EditableFormDefinition {
if (maybeState === null) {
return false
}
Expand All @@ -24,7 +24,7 @@ function parseState(maybeState: unknown): maybeState is FormDefinition {
* Simple, right?
*/
export class EditFormView extends ItemView {
formState: FormDefinition = { title: '', name: '', fields: [] };
formState: EditableFormDefinition = { title: '', name: '', fields: [] };
formEditor!: FormEditor;
constructor(readonly leaf: WorkspaceLeaf, readonly plugin: ModalFormPlugin) {
super(leaf);
Expand All @@ -40,6 +40,7 @@ export class EditFormView extends ItemView {
}

async onOpen() {
this.containerEl.empty()
this.formEditor = new FormEditor({
target: this.containerEl,
props: {
Expand Down
4 changes: 1 addition & 3 deletions src/views/FormBuilder.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@
.wrapper,
form {
max-height: 100%;
min-height: 100%;
height: 100%;
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -396,9 +397,6 @@
border: none;
padding: 0;
}
.p-2 {
padding: 0.5rem;
}
.hint {
color: var(--color-base-70);
}
Expand Down

0 comments on commit 53f10b3

Please sign in to comment.