File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -6,14 +6,17 @@ The HTML `<dialog>` tag implemented in Ruby.
66
77## Parameters
88
9- This component can take 2 optional configuration params and either yield content or display what gets passed to the ` text ` configuration param.
9+ This component can take 3 optional configuration params and either yield content or display what gets passed to the ` text ` configuration param.
1010
1111#### # id (optional)
1212Expects a string with all ids the ` <dialog> ` should have.
1313
1414#### # class (optional)
1515Expects a string with all classes the ` <dialog> ` should have.
1616
17+ #### # open (optional)
18+ Expects a boolean. If set to true, the ` <dialog> ` will be visible.
19+
1720## Example 1: Yield a given block
1821
1922``` ruby
@@ -33,13 +36,13 @@ returns
3336## Example 2: Render ` options[:text] ` param
3437
3538``` ruby
36- dialog id: ' foo' , class : ' bar' , text: ' Dialog example 2'
39+ dialog id: ' foo' , class : ' bar' , text: ' Dialog example 2' , open: true
3740```
3841
3942returns
4043
4144``` html
42- <dialog id =" foo" class =" bar" >
45+ <dialog id =" foo" class =" bar" open = " open " >
4346 Dialog example 2
4447</dialog >
4548```
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ def response
1010 dialog text : 'Simple dialog tag'
1111
1212 # Enhanced dialog
13- dialog id : 'my-id' , class : 'my-class' do
13+ dialog id : 'my-id' , class : 'my-class' , open : true do
1414 plain 'Enhanced dialog tag'
1515 end
1616 }
@@ -23,7 +23,7 @@ def response
2323
2424 expected_static_output = <<~HTML
2525 < dialog > Simple dialog tag</ dialog >
26- < dialog id ="my-id " class ="my-class "> Enhanced dialog tag</ dialog >
26+ < dialog id ="my-id " open =" open " class ="my-class "> Enhanced dialog tag</ dialog >
2727 HTML
2828
2929 expect ( stripped ( static_output ) ) . to include ( stripped ( expected_static_output ) )
You can’t perform that action at this time.
0 commit comments