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.
6
6
7
7
## Parameters
8
8
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.
10
10
11
11
#### # id (optional)
12
12
Expects a string with all ids the ` <dialog> ` should have.
13
13
14
14
#### # class (optional)
15
15
Expects a string with all classes the ` <dialog> ` should have.
16
16
17
+ #### # open (optional)
18
+ Expects a boolean. If set to true, the ` <dialog> ` will be visible.
19
+
17
20
## Example 1: Yield a given block
18
21
19
22
``` ruby
@@ -33,13 +36,13 @@ returns
33
36
## Example 2: Render ` options[:text] ` param
34
37
35
38
``` ruby
36
- dialog id: ' foo' , class : ' bar' , text: ' Dialog example 2'
39
+ dialog id: ' foo' , class : ' bar' , text: ' Dialog example 2' , open: true
37
40
```
38
41
39
42
returns
40
43
41
44
``` html
42
- <dialog id =" foo" class =" bar" >
45
+ <dialog id =" foo" class =" bar" open = " open " >
43
46
Dialog example 2
44
47
</dialog >
45
48
```
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ def response
10
10
dialog text : 'Simple dialog tag'
11
11
12
12
# Enhanced dialog
13
- dialog id : 'my-id' , class : 'my-class' do
13
+ dialog id : 'my-id' , class : 'my-class' , open : true do
14
14
plain 'Enhanced dialog tag'
15
15
end
16
16
}
@@ -23,7 +23,7 @@ def response
23
23
24
24
expected_static_output = <<~HTML
25
25
< 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 >
27
27
HTML
28
28
29
29
expect ( stripped ( static_output ) ) . to include ( stripped ( expected_static_output ) )
You can’t perform that action at this time.
0 commit comments