Skip to content

Commit 7957734

Browse files
authored
docs(modal): clarify changing height of sheet modal (#3589)
1 parent b5cef0c commit 7957734

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

docs/api/modal.md

+10-8
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,8 @@ Here's a simplified example illustrating how a child component can interact with
9898
import CanDismissChildStateExample from '@site/static/usage/v8/modal/can-dismiss/child-state/index.md';
9999

100100
<CanDismissChildStateExample />
101-
102-
## Types of modals
103101

104-
### Card Modal
102+
## Card Modal
105103

106104
Developers can create a card modal effect where the modal appears as a card stacked on top of your app's main content. To create a card modal, developers need to set the `presentingElement` property on `ion-modal`.
107105

@@ -117,10 +115,10 @@ import CardExample from '@site/static/usage/v8/modal/card/basic/index.md';
117115

118116
<CardExample />
119117

120-
### Sheet Modal
118+
## Sheet Modal
121119

122120
:::info
123-
[Content](./content) must be used inside of the sheet modal otherwise your modal content will not be scrollable.
121+
[Content](./content) should be used inside of the sheet modal if you want your modal content to be scrollable.
124122
:::
125123

126124
Developers can create a sheet modal effect similar to the drawer components available in maps applications. To create a sheet modal, developers need to set the `breakpoints` and `initialBreakpoint` properties on `ion-modal`.
@@ -135,19 +133,23 @@ import SheetExample from '@site/static/usage/v8/modal/sheet/basic/index.md';
135133

136134
<SheetExample />
137135

138-
#### Interacting with background content
136+
### Interacting with background content
139137

140138
import SheetBackgroundContentExample from '@site/static/usage/v8/modal/sheet/background-content/index.md';
141139

142140
<SheetBackgroundContentExample />
143141

144-
#### Auto Height Sheet
142+
### Custom Sheet Height
143+
144+
Developers should use the `--height` CSS Variable to change the height of the sheet modal instead of changing the last breakpoint in the `breakpoints` array. The reason for this is changing the last breakpoint in the `breakpoints` array to a value less than `1` will cause some of the modal to be inaccessible outside of the viewport.
145+
146+
The following example shows how to get a sheet modal that is automatically sized based on its content. Note that by keeping the maximum breakpoint at `1` we ensure that the entire modal is accessible in the viewport.
145147

146148
import SheetAutoHeightExample from '@site/static/usage/v8/modal/sheet/auto-height/index.md';
147149

148150
<SheetAutoHeightExample />
149151

150-
#### Handle Behavior
152+
### Handle Behavior
151153

152154
Sheet modals can optionally render a handle indicator used for dragging the sheet between breakpoints. The `handleBehavior` property can be used to configure the behavior of when the handle is activated by the user.
153155

versioned_docs/version-v7/api/modal.md

+9-7
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,7 @@ import CanDismissChildStateExample from '@site/static/usage/v7/modal/can-dismiss
103103

104104
<CanDismissChildStateExample />
105105

106-
## Types of modals
107-
108-
### Card Modal
106+
## Card Modal
109107

110108
Developers can create a card modal effect where the modal appears as a card stacked on top of your app's main content. To create a card modal, developers need to set the `presentingElement` property on `ion-modal`.
111109

@@ -121,7 +119,7 @@ import CardExample from '@site/static/usage/v7/modal/card/basic/index.md';
121119

122120
<CardExample />
123121

124-
### Sheet Modal
122+
## Sheet Modal
125123

126124
:::info
127125
[Content](./content) must be used inside of the sheet modal otherwise your modal content will not be scrollable.
@@ -139,19 +137,23 @@ import SheetExample from '@site/static/usage/v7/modal/sheet/basic/index.md';
139137

140138
<SheetExample />
141139

142-
#### Interacting with background content
140+
### Interacting with background content
143141

144142
import SheetBackgroundContentExample from '@site/static/usage/v7/modal/sheet/background-content/index.md';
145143

146144
<SheetBackgroundContentExample />
147145

148-
#### Auto Height Sheet
146+
### Custom Sheet Height
147+
148+
Developers should use the `--height` CSS Variable to change the height of the sheet modal instead of changing the last breakpoint in the `breakpoints` array. The reason for this is changing the last breakpoint in the `breakpoints` array to a value less than `1` will cause some of the modal to be inaccessible outside of the viewport.
149+
150+
The following example shows how to get a sheet modal that is automatically sized based on its content. Note that by keeping the maximum breakpoint at `1` we ensure that the entire modal is accessible in the viewport.
149151

150152
import SheetAutoHeightExample from '@site/static/usage/v7/modal/sheet/auto-height/index.md';
151153

152154
<SheetAutoHeightExample />
153155

154-
#### Handle Behavior
156+
### Handle Behavior
155157

156158
Sheet modals can optionally render a handle indicator used for dragging the sheet between breakpoints. The `handleBehavior` property can be used to configure the behavior of when the handle is activated by the user.
157159

0 commit comments

Comments
 (0)