Jinntec / Fore

Fore - declarative user interfaces in plain HTML
MIT License
82 stars 11 forks source link

repeat via attributes #184

Closed JoernT closed 1 year ago

JoernT commented 1 year ago

Discussed in https://github.com/Jinntec/Fore/discussions/38

Originally posted by **JoernT** June 4, 2021 # repeat attributes `fx-repeat` element is fine but does not work out in some use cases. Consider this: ```
``` Using fx-repeat as is would force: ```
``` Not at all want you want - breaks content-model of `
    ` and may even break styling or require workarounds. So in consequence what we'll need is: ```
    ``` ## Possible implementation At initial refresh the fx-form: * querySelectorAll('[data-ref]') * create fx-repeat for each of them like so: ``` ::shadowDOM
  • 1
  • 2
  • 3
    • ``` `fx-repeat` would become an invisible wrapper around the actual repeated element and: * move `data-ref` to `fx-repeat/@ref` * move `