Replies: 1 comment 1 reply
-
The node tree its is own tree, not fully related with the dom tree, even tho they are similar in some parts. For your second case there is a problem there because you shouldn't have nested forms in your tree, so $root would always relate to the form. For that case if you need to nest forms, the nested one MUST have |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Feature
To locate a node from a start node, the
FormKitNode
object has aat()
function where you can pass a node address or a dot-syntax relative path. There are some special tokens available for this function (see Transversal tokens).I would like to propose a new token
$form
.Why FormKit need this
Most inputs are wrapped by a form. Navigating to a specific node based on a relative path can be easier by starting from the form node.
However, not all node trees start with a form as root node, so
$root
is not necessary equal to$form
.I consider the node tree to be somehow related to the vue component tree, because having a component A with a FormKit
type="form"
and somewhere below it in the vue component tree another component B with a FormKittype="form"
(for example in a modal component which consists of its own form); and starting from a node placed below the form node of component B, the associated$root
node will be the form node of component A, not the second form of component B.Implementation
Beta Was this translation helpful? Give feedback.
All reactions