Skip to content

Conversation

@justinallenmarsh
Copy link
Contributor

There is a bug when rendering a dialog in the open state. The connect method tries to call preventDefault() on an event that doesn't exist which causes an error.

Steps to reproduce...

Render the following in a view template and you will get the following error
TypeError: Cannot read properties of undefined (reading 'preventDefault')
CleanShot 2025-05-24 at 19 26 57@2x

render RubyUI::Dialog.new(open: true) do
  render RubyUI::DialogContent.new do
    div do
      "hello"
    end
  end
end

This allows the event to be undefined and be able to open without issue.

@cirdes cirdes self-requested a review June 16, 2025 22:44
@cirdes cirdes merged commit e827160 into ruby-ui:main Jun 16, 2025
2 checks passed
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 this pull request may close these issues.

2 participants