Skip to content

Commit 547ee34

Browse files
add missing 'open' option to docs&test
1 parent 2a65a49 commit 547ee34

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

docs/components/dialog.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff 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)
1212
Expects a string with all ids the `<dialog>` should have.
1313

1414
#### # class (optional)
1515
Expects 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

3942
returns
4043

4144
```html
42-
<dialog id="foo" class="bar">
45+
<dialog id="foo" class="bar" open="open">
4346
Dialog example 2
4447
</dialog>
4548
```

spec/usage/components/dialog_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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))

0 commit comments

Comments
 (0)