Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combobox options do not work within a dialog element #196

Closed
JoshAntBrown opened this issue Aug 19, 2024 · 0 comments · Fixed by #197
Closed

Combobox options do not work within a dialog element #196

JoshAntBrown opened this issue Aug 19, 2024 · 0 comments · Fixed by #197

Comments

@JoshAntBrown
Copy link
Contributor

JoshAntBrown commented Aug 19, 2024

Bug description

When a combobox is within a dialog element clicking any option in the listbox fails to register and select that option.

To Reproduce

Steps to reproduce the behavior:

  1. Implement the following example dialog with a form that contains a combobox.
<dialog id="myDialog">
  <%= form_with model: Movie.first do |form| %>
    <%= form.combobox :rating, Movie.ratings %>
  <% end %>
</dialog>
<button onclick="myDialog.showModal()">Show modal</button>
  1. Notice the list of options appear as expected, with appropriate hover states
  2. Attempt to select one of the options in the combobox
  3. Notice that the listbox vanishes and nothing else happens, the option you clicked on has not been selected.

Expected behaviour

The option clicked on to be selected and entered into the combobox input.

Version

I'm currently using Gem version 0.3.1 in my project, but I also tested this in the main branch of this project.

Desktop info

  • OS: MacOS
  • Browsers:
    • Brave 1.68.134, using Chromium: 127.0.6533.88
    • Firefox 129.0.1
    • Google Chrome 127.0.6533.120

I also tested in Safari 17.5, but it actually works there.

Additional context

I'll keep trying to diagnose the issue but thought I should create an issue in case anyone else has any ideas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant