avo-hq/avo

field: pass all html options

开放

#3,145 创建于 2024年8月16日

 (4 条评论) (0 个反应) (0 位负责人)Ruby (308 个派生)user submission
EnhancementHelp wantedStale exempt

仓库指标

星标
 (1,778 个星标)
PR 合并指标
 (平均合并 1天 6小时) (30 天内合并 67 个 PR)

描述

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
  • ...

贡献者指南