File tree Expand file tree Collapse file tree 1 file changed +21
-16
lines changed
packages/spectrum/src/complex Expand file tree Collapse file tree 1 file changed +21
-16
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,9 @@ import {
53
53
} from '@react-spectrum/table' ;
54
54
import {
55
55
ActionButton ,
56
+ AlertDialog ,
56
57
Button ,
58
+ DialogTrigger ,
57
59
Flex ,
58
60
Header ,
59
61
Heading ,
@@ -271,23 +273,26 @@ class SpectrumTableArrayControl extends React.Component<
271
273
{ [
272
274
...rowCells ,
273
275
< Cell key = { `delete-row-${ index } ` } >
274
- < TooltipTrigger delay = { 0 } >
275
- < ActionButton
276
- aria-label = { `Delete row at ${ index } ` }
277
- onPress = { ( ) => {
278
- if (
279
- window . confirm (
280
- 'Are you sure you wish to delete this item?'
281
- )
282
- ) {
283
- this . confirmDelete ( childPath , index ) ;
284
- }
285
- } }
276
+ < DialogTrigger >
277
+ < TooltipTrigger delay = { 0 } >
278
+ < ActionButton aria-label = { `Delete row at ${ index } ` } >
279
+ < Delete />
280
+ </ ActionButton >
281
+ < Tooltip > Delete</ Tooltip >
282
+ </ TooltipTrigger >
283
+ < AlertDialog
284
+ variant = 'confirmation'
285
+ title = 'Delete'
286
+ primaryActionLabel = 'Delete'
287
+ cancelLabel = 'Cancel'
288
+ autoFocusButton = 'primary'
289
+ onPrimaryAction = { ( ) =>
290
+ this . confirmDelete ( childPath , index )
291
+ }
286
292
>
287
- < Delete />
288
- </ ActionButton >
289
- < Tooltip > Delete</ Tooltip >
290
- </ TooltipTrigger >
293
+ Are you sure you wish to delete this item?
294
+ </ AlertDialog >
295
+ </ DialogTrigger >
291
296
</ Cell > ,
292
297
] }
293
298
</ Row >
You can’t perform that action at this time.
0 commit comments