-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix interactivity of listbox options when combobox is in a dialog (#197)
Co-authored-by: Jose Farias <jose@farias.mx>
- Loading branch information
1 parent
b07617e
commit 79302f8
Showing
6 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Controller } from "@hotwired/stimulus" | ||
|
||
export default class extends Controller { | ||
static targets = [ "dialog" ] | ||
|
||
open() { | ||
this.dialogTarget.showModal() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<%= tag.style nonce: content_security_policy_nonce do %> | ||
dialog { | ||
height: 80vh; | ||
width: 80vw; | ||
} | ||
<% end %> | ||
|
||
<article data-controller="dialog"> | ||
<dialog data-dialog-target="dialog"> | ||
<%= form_with model: Movie.new do |form| %> | ||
<%= form.combobox :rating, Movie.ratings %> | ||
<% end %> | ||
</dialog> | ||
|
||
<button data-action="dialog#open">Show modal</button> | ||
</article> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters