Dyldog / luhman-obsidian-plugin

GNU General Public License v3.0
61 stars 18 forks source link

[BUG] Setting Page Template File Input Won't let you type more than one character at a time. #52

Open barnes7td opened 1 year ago

barnes7td commented 1 year ago

Issue Searching

OtherIssues

None

Description

In the Settings menu every time you type a character in the Template File text input, the input box loses focus, only allowing the user to type one character at a time.

Reproduction steps

Go to the Luhman Settings inside of the Obsidian Settings. Add or remove a character in the text input for Template File.

Expected Result

I expect that I could keep typing until I type the full path to the template file.

Actual Result

I type one character, the input box loses focus, and I have to click back on the text input in order to type again.

Version

1.2.0 (Current Version)

Relevent log output

No response

Screenshots

No response

Other Notes

I am a developer. The reason this happens is because this.display() is called on ever onChange event of the text input, effectively removing the focus of the text input.

I have a fix worked out. I want to contribute. Is there a protocol for a PR to this repo?

agctute commented 1 year ago

@barnes7td Your commit also works to fix this bug, I made a "less is more" alternative in the above PR. Maybe @Eforen can choose?

barnes7td commented 1 year ago

@agctute The problem with not calling this.display() in your version, means the config screen won't update (hide/show options dependent on the on the contents of this input field). That's why I did the more involved solution.

Eforen commented 1 year ago

what do you mean will not allow you to type more then one character at a time?

agctute commented 1 year ago

Every time a character is input into the text box, the box behaves as if Esc is pressed immediately after. You have to click on the text box again in order to input the next character, in which case the problem repeats.