Prefer incoming open prop over OpenClosed state (#1360)

* prefer incoming `open` prop over OpenClosed state

* update changelog
This commit is contained in:
Robin Malfait
2022-04-23 23:27:19 +02:00
committed by GitHub
parent fe034b4ed6
commit c8cf26ffcb
3 changed files with 4 additions and 17 deletions
@@ -173,13 +173,6 @@ let DialogRoot = forwardRefWithAs(function Dialog<
}
let dialogState = open ? DialogStates.Open : DialogStates.Closed
let visible = (() => {
if (usesOpenClosedState !== null) {
return usesOpenClosedState === State.Open
}
return dialogState === DialogStates.Open
})()
let [state, dispatch] = useReducer(stateReducer, {
titleId: null,
@@ -357,7 +350,7 @@ let DialogRoot = forwardRefWithAs(function Dialog<
slot,
defaultTag: DEFAULT_DIALOG_TAG,
features: DialogRenderFeatures,
visible,
visible: dialogState === DialogStates.Open,
name: 'Dialog',
})}
</DescriptionProvider>