avo-hq/avo

field: pass all html options

Open

#3,145 opened on Aug 16, 2024

View on GitHub
 (4 comments) (0 reactions) (0 assignees)Ruby (308 forks)user submission
EnhancementHelp wantedStale exempt

Repository metrics

Stars
 (1,778 stars)
PR merge metrics
 (Avg merge 1d 1h) (82 merged PRs in 30d)

Description

Feature

https://docs.avohq.io/3.0/field-options.html#html only allow for style, classes, or data. It would be great (just as like with mapkick_options for maps) that you pass ALL options to the html field (instead of only the whilelisted ones)

field :name, as: :text, html: {
  edit: {
    wrapper: {
      min: 1,
      max:  100,
      pattern: ...,
    }
}

(sidenote: when this same logic is used within actions, we can also consider https://github.com/avo-hq/avo/issues/2803 closed)

Current workarounds

None

Additional context

This can (amongst other) help to create html validations where relevant

  • min
  • max
  • pattern
  • minlength
  • ...

Contributor guide