Sha256: 4601018c18d2ea6ea47f515f079ba482892eaf51d74f3a99c33ecad75c9faf68
Contents?: true
Size: 1.17 KB
Versions: 55
Compression:
Stored size: 1.17 KB
Contents
<% options = [ { label: 'Windows', value: '#FFA500' }, { label: 'Siding', value: '#FF0000' }, { label: 'Doors', value: '#00FF00' }, { label: 'Roofs', value: '#0000FF' }, ] %> <%= pb_rails("typeahead", props: { id: "typeahead-pills-example1", placeholder: "All Colors", options: options, label: "Colors", name: :foo, is_multi: false }) %> <!-- This section is an example of the available JavaScript event hooks --> <%= javascript_tag defer: "defer" do %> document.addEventListener("pb-typeahead-kit-typeahead-pills-example1-result-option-select", function(event) { console.log('Option selected') console.dir(event.detail) }) document.addEventListener("pb-typeahead-kit-typeahead-pills-example1-result-option-remove", function(event) { console.log('Option removed') console.dir(event.detail) }) document.addEventListener("pb-typeahead-kit-typeahead-pills-example1-result-clear", function() { console.log('All options cleared') }) document.querySelector('#clear-pills').addEventListener('click', function() { document.dispatchEvent(new CustomEvent('pb-typeahead-kit-typeahead-pills-example1:clear')) }) <% end %>
Version data entries
55 entries across 55 versions & 1 rubygems