Fork me on GitHub
#fulcro
<
2022-10-10
>
roklenarcic18:10:06

Saw this in StandardFormContainer render:

(div {:key       (str (comp/get-ident form-instance))
      :className (or
                   (?! (suo/get-rendering-options form-instance suo/layout-class) env)
                   (?! (comp/component-options form-instance suo/layout-class) env)
                   (?! (comp/component-options form-instance ::top-level-class) env)
                   "ui container")}
     ...)
Now this has me confused. ::rendering-options are supposed to be global defaults if defined. Wouldn’t it then make sense that the (suo/get-rendering-options form-instance suo/layout-class) statement was penultimate expression in or, just before “ui container”? Now it seems you cannot override this default by providing suo/layout-class or ::top-level-class on the component itself… there seems to be even more of these, where suo/get-rendering-options will take precedence over everything else.

tony.kay22:10:19

I think perhaps there was some evolution here…and now making a change would be a breaking one. The get-rendering-options is now the preferred method of specifying/getting them, and the others will fall through…but I may not have been thinking clearly at the time. I don’t have a clear memory of my reasoning, but I can say that since a change to this logic would break things, the only way to “fix it” would be to define something new, make it preferred, and deprecate other uses, which in fact may have been what I was doing there.

roklenarcic07:10:14

But putting suo/layout-class in rendering options is a global thing, that goes into runtime atom, so it would make sense that suo/layout-class on form component options would take precedence. I doubt that it will break people’s code, why would someone who used global custom layout-class, have it also specified on some components to be a different layout-class, when it doesn’t do anything?

tony.kay17:10:00

you’re right

tony.kay17:10:20

send a PR and drop that to the bottom of that stack?

roklenarcic19:10:13

I am no CSS expert so can someone weigh in on my PR? https://github.com/fulcrologic/fulcro-rad-semantic-ui/pull/28

❤️ 1