obsidian-modal-form icon indicating copy to clipboard operation
obsidian-modal-form copied to clipboard

[Feature request] Conditional Rendering of Form Input

Open aaachen opened this issue 1 year ago • 1 comments

My Usecase

I log the exercises I do and the associated information. Different exercises have different information that I need to input. For example, running requires input miles and time, push up requires input reps and sets, dumbbell curl requires reps, sets, and weight.

I want to customize my form in such a way that depending on the exercise picked, the form renders the correct inputs

Describe the solution you'd like

This would be an advanced option configurable for each form input (call it Conditional Render)

Conditional Render is a js function that given the state of the form object, return boolean for whether to render the input.

Work around I use quick add, the workaround here for that is to create separate forms and chain them (i.e. using the exercise example, first ask for the exercise, then the correct form to show)

This is less ideal as I prefer just one reactive form

aaachen avatar Feb 01 '24 06:02 aaachen

This has been in my mind for some time already, and believe it or not, the implementation I was thinking was exactly the same. This is a duplicate of #71 , but because that one were 2 requests in one, and I already fulfilled one, I will favor this request as is better written and more focused.

danielo515 avatar Feb 01 '24 09:02 danielo515

This has been already implemented some time ago. Not sure why I forgot to close this issue.Hope you find it useful

danielo515 avatar Jul 19 '24 16:07 danielo515