test(modal): test secondaryButtons prop, updated click:button--secondary custom event

This commit is contained in:
Eric Y Liu 2021-07-04 06:11:26 -07:00
commit 177250e8df
2 changed files with 8 additions and 2 deletions

View file

@ -15,5 +15,10 @@
<ModalBody hasForm>
<Checkbox labelText="I have reviewed the changes" bind:checked />
</ModalBody>
<ModalFooter primaryButtonText="Proceed" primaryButtonDisabled="{!checked}" />
<ModalFooter
primaryButtonText="Proceed"
primaryButtonDisabled="{!checked}"
secondaryButtons="{[{ text: 'Cancel' }, { text: 'Duplicate' }]}"
on:click:button--secondary="{({ detail }) => {}}"
/>
</ComposedModal>

View file

@ -10,8 +10,9 @@
bind:open
modalHeading="Create database"
primaryButtonText="Confirm"
secondaryButtons="{[{ text: 'Cancel' }, { text: 'Duplicate' }]}"
secondaryButtonText="Cancel"
on:click:button--secondary="{() => (open = false)}"
on:click:button--secondary="{({ detail }) => (open = false)}"
on:open
on:close
on:submit