mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
docs: rename ComboBox
example, do not open modal in DatePicker
by default (#1374)
* docs(combo-box): "Selected id" -> " Initial selected id" * docs(date-picker): do not open modal by default to prevent stealing focusing
This commit is contained in:
parent
c346b8edc0
commit
45627aad1f
2 changed files with 13 additions and 3 deletions
|
@ -24,7 +24,7 @@ Override the default slot to customize the display of each item. Access the item
|
||||||
|
|
||||||
<FileSource src="/framed/ComboBox/ComboBoxSlot" />
|
<FileSource src="/framed/ComboBox/ComboBoxSlot" />
|
||||||
|
|
||||||
### Selected id
|
### Initial selected id
|
||||||
|
|
||||||
<ComboBox titleText="Contact" placeholder="Select contact method"
|
<ComboBox titleText="Contact" placeholder="Select contact method"
|
||||||
selectedId="1"
|
selectedId="1"
|
||||||
|
|
|
@ -1,12 +1,22 @@
|
||||||
<script>
|
<script>
|
||||||
import { Modal, DatePicker, DatePickerInput } from "carbon-components-svelte";
|
import {
|
||||||
|
Button,
|
||||||
|
Modal,
|
||||||
|
DatePicker,
|
||||||
|
DatePickerInput,
|
||||||
|
} from "carbon-components-svelte";
|
||||||
|
|
||||||
|
let open = false;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<Button on:click="{() => (open = true)}">Select date</Button>
|
||||||
|
|
||||||
<Modal
|
<Modal
|
||||||
open
|
bind:open
|
||||||
modalHeading="Meeting date"
|
modalHeading="Meeting date"
|
||||||
primaryButtonText="Confirm"
|
primaryButtonText="Confirm"
|
||||||
secondaryButtonText="Cancel"
|
secondaryButtonText="Cancel"
|
||||||
|
on:click:button--secondary="{() => (open = false)}"
|
||||||
>
|
>
|
||||||
<DatePicker datePickerType="single" style="min-height: 420px">
|
<DatePicker datePickerType="single" style="min-height: 420px">
|
||||||
<DatePickerInput labelText="Meeting date" placeholder="mm/dd/yyyy" />
|
<DatePickerInput labelText="Meeting date" placeholder="mm/dd/yyyy" />
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue