Skip to content

Commit

Permalink
Generate an id if one is not passed to combobox (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
josefarias authored Mar 5, 2024
1 parent bee5632 commit f68a3d7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/presenters/hotwire_combobox/component.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require "securerandom"

class HotwireCombobox::Component
attr_reader :options, :dialog_label

Expand Down Expand Up @@ -187,7 +189,7 @@ def async_src


def canonical_id
id || form&.field_id(name)
id || form&.field_id(name) || SecureRandom.uuid
end


Expand Down

0 comments on commit f68a3d7

Please sign in to comment.