Skip to content

Commit f68edea

Browse files
authored
fix(Modal): fix button ref (#5699)
This change fixes `.button` internal class property of `<Modal>` not being updated with the internal primary button, due to stale prop name used for `<Button>` for its `ref`. Fixes #5685.
1 parent 64692ab commit f68edea

File tree

2 files changed

+1
-55
lines changed

2 files changed

+1
-55
lines changed

packages/react/src/components/Modal/Modal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ export default class Modal extends Component {
408408
kind={danger ? 'danger' : 'primary'}
409409
disabled={primaryButtonDisabled}
410410
onClick={onRequestSubmit}
411-
inputref={this.button}>
411+
ref={this.button}>
412412
{primaryButtonText}
413413
</Button>
414414
</div>

packages/react/src/components/ModalWrapper/__snapshots__/ModalWrapper-test.js.snap

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -172,33 +172,6 @@ exports[`ModalWrapper should render 1`] = `
172172
</ForwardRef(Button)>
173173
<ForwardRef(Button)
174174
disabled={false}
175-
inputref={
176-
Object {
177-
"current": <button
178-
aria-label="close the modal"
179-
class="bx--modal-close"
180-
title="close the modal"
181-
type="button"
182-
>
183-
<svg
184-
aria-label="close the modal"
185-
class="bx--modal-close__icon"
186-
focusable="false"
187-
height="20"
188-
preserveAspectRatio="xMidYMid meet"
189-
role="img"
190-
style="will-change: transform;"
191-
viewBox="0 0 32 32"
192-
width="20"
193-
xmlns="http://www.w3.org/2000/svg"
194-
>
195-
<polygon
196-
points="24 9.4 22.6 8 16 14.6 9.4 8 8 9.4 14.6 16 8 22.6 9.4 24 16 17.4 22.6 24 24 22.6 17.4 16 24 9.4"
197-
/>
198-
</svg>
199-
</button>,
200-
}
201-
}
202175
kind="primary"
203176
onClick={[Function]}
204177
tabIndex={0}
@@ -207,33 +180,6 @@ exports[`ModalWrapper should render 1`] = `
207180
<button
208181
className="bx--btn bx--btn--primary"
209182
disabled={false}
210-
inputref={
211-
Object {
212-
"current": <button
213-
aria-label="close the modal"
214-
class="bx--modal-close"
215-
title="close the modal"
216-
type="button"
217-
>
218-
<svg
219-
aria-label="close the modal"
220-
class="bx--modal-close__icon"
221-
focusable="false"
222-
height="20"
223-
preserveAspectRatio="xMidYMid meet"
224-
role="img"
225-
style="will-change: transform;"
226-
viewBox="0 0 32 32"
227-
width="20"
228-
xmlns="http://www.w3.org/2000/svg"
229-
>
230-
<polygon
231-
points="24 9.4 22.6 8 16 14.6 9.4 8 8 9.4 14.6 16 8 22.6 9.4 24 16 17.4 22.6 24 24 22.6 17.4 16 24 9.4"
232-
/>
233-
</svg>
234-
</button>,
235-
}
236-
}
237183
onClick={[Function]}
238184
tabIndex={0}
239185
type="button"

0 commit comments

Comments
 (0)