File tree Expand file tree Collapse file tree 3 files changed +4
-17
lines changed
@headlessui-react/src/components/dialog
@headlessui-vue/src/components/dialog Expand file tree Collapse file tree 3 files changed +4
-17
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
37
37
- Allow ` Enter ` for form submit in ` RadioGroup ` , ` Switch ` and ` Combobox ` improvements ([ #1285 ] ( https://github.com/tailwindlabs/headlessui/pull/1285 ) )
38
38
- add React 18 compatibility ([ #1326 ] ( https://github.com/tailwindlabs/headlessui/pull/1326 ) )
39
39
- Add explicit ` multiple ` prop ([ #1355 ] ( https://github.com/tailwindlabs/headlessui/pull/1355 ) )
40
+ - Prefer incoming ` open ` prop over OpenClosed state ([ #1360 ] ( https://github.com/tailwindlabs/headlessui/pull/1360 ) )
40
41
41
42
### Added
42
43
@@ -78,6 +79,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
78
79
- Allow ` Enter ` for form submit in ` RadioGroup ` , ` Switch ` and ` Combobox ` improvements ([ #1285 ] ( https://github.com/tailwindlabs/headlessui/pull/1285 ) )
79
80
- Add explicit ` multiple ` prop ([ #1355 ] ( https://github.com/tailwindlabs/headlessui/pull/1355 ) )
80
81
- fix ` nullable ` prop for Vue ([ 2b109548b1a94a30858cf58c8f525554a1c12cbb] ( https://github.com/tailwindlabs/headlessui/commit/2b109548b1a94a30858cf58c8f525554a1c12cbb ) )
82
+ - Prefer incoming ` open ` prop over OpenClosed state ([ #1360 ] ( https://github.com/tailwindlabs/headlessui/pull/1360 ) )
81
83
82
84
### Added
83
85
Original file line number Diff line number Diff line change @@ -173,13 +173,6 @@ let DialogRoot = forwardRefWithAs(function Dialog<
173
173
}
174
174
175
175
let dialogState = open ? DialogStates . Open : DialogStates . Closed
176
- let visible = ( ( ) => {
177
- if ( usesOpenClosedState !== null ) {
178
- return usesOpenClosedState === State . Open
179
- }
180
-
181
- return dialogState === DialogStates . Open
182
- } ) ( )
183
176
184
177
let [ state , dispatch ] = useReducer ( stateReducer , {
185
178
titleId : null ,
@@ -357,7 +350,7 @@ let DialogRoot = forwardRefWithAs(function Dialog<
357
350
slot,
358
351
defaultTag : DEFAULT_DIALOG_TAG ,
359
352
features : DialogRenderFeatures ,
360
- visible,
353
+ visible : dialogState === DialogStates . Open ,
361
354
name : 'Dialog' ,
362
355
} ) }
363
356
</ DescriptionProvider >
Original file line number Diff line number Diff line change @@ -113,14 +113,6 @@ export let Dialog = defineComponent({
113
113
}
114
114
115
115
let dialogState = computed ( ( ) => ( open . value ? DialogStates . Open : DialogStates . Closed ) )
116
- let visible = computed ( ( ) => {
117
- if ( usesOpenClosedState !== null ) {
118
- return usesOpenClosedState . value === State . Open
119
- }
120
-
121
- return dialogState . value === DialogStates . Open
122
- } )
123
-
124
116
let enabled = computed ( ( ) => dialogState . value === DialogStates . Open )
125
117
126
118
let hasNestedDialogs = computed ( ( ) => nestedDialogCount . value > 1 ) // 1 is the current dialog
@@ -307,7 +299,7 @@ export let Dialog = defineComponent({
307
299
slot,
308
300
attrs,
309
301
slots,
310
- visible : visible . value ,
302
+ visible : dialogState . value === DialogStates . Open ,
311
303
features : Features . RenderStrategy | Features . Static ,
312
304
name : 'Dialog' ,
313
305
} )
You can’t perform that action at this time.
0 commit comments