Comments (5)
Thanks for raising this bug.
In CodeSandbox, the DatePicker
for type "single" or "range" is throwing an error. Strangely, the Storybook works.
from carbon-components-svelte.
After some more debugging, I'm having trouble reproducing the error outside of CodeSandbox. However, I believe the error results from base
(first parameter of flatpickr
) being read as "null."
The DatePicker
component works fine in:
- Storybook
- Non-CodeSandbox Webpack set-up
Furthermore, I've isolated the DatePicker
component in CodeSandbox, and it is working fine: https://codesandbox.io/s/datepicker-xcuo6
@drop1down Could you provide more info on your set-up? Were you just using the CodeSandbox linked in the README?
from carbon-components-svelte.
i used on local machine with fresh template from here:
https://github.com/sveltejs/template/archive/master.zip
add carbon-components-svelte to package.json
npm install
replace App.svelte with this:
<script>
import { Datepicker } from 'carbon-components-svelte';
</script>
<main>
<DatePicker />
</main>
npm run dev
this is my result in any browser / win 10:
<div class="bx--form-item"><div class="bx--date-picker bx--date-picker--simple" id="0.6775614213691941"></div></div>
from carbon-components-svelte.
Sorry, i added your example to my code and this works:
<script>
import { DatePicker,DatePickerInput} from "carbon-components-svelte";
let value = "";
</script>
<svelte:head>
<link
rel="stylesheet"
href="https://unpkg.com/[email protected]/css/carbon-components.min.css" />
</svelte:head>
<DatePicker
id="date-picker"
bind:value
datePickerType="single"
on:change={({ detail }) => {
console.log('change', detail);
}}>
<DatePickerInput id="date-picker-input"
placeholder='mm/dd/yyyy'
on:close={() => {
console.log('on:close');
}}
on:input={() => {
console.log('on:input');
}} />
</DatePicker>
Is this correct way how to use it?
I thought at first <DatePicker />
was enough
I had some problems with carbon documentation @ StoryBook,
because examples and info was hidden. I need to click "Show Info".
from carbon-components-svelte.
@drop1down Yes, that's the correct way to use it. The Storybook story source code is in same folder as the component; it's a bit hidden right now.
We're rewriting the documentation from scratch where the code usage is as the forefront (#100).
from carbon-components-svelte.
Related Issues (20)
- RadioButton checked doesn't change HOT 1
- Button with icon only - always shows tooltip HOT 2
- TooltipIcon memory leak HOT 3
- TextInput v11 HOT 4
- PasswordInput v11 HOT 5
- Alphabetize prop names in documentation HOT 5
- Layer (new component) HOT 3
- Use `Button` component instead of native `button` in `HeaderGlobalAction` HOT 1
- Popover v11 HOT 5
- Support nested properties in DataTable filtering search HOT 3
- IconButton v11 HOT 1
- DataTable on:click:row is missing target and currentTarget information
- ContextMenu prevents context menu invocations outside of the target HOT 2
- TypeScript cannot find CarbonTheme type when using Theme HOT 5
- `ToastNotification` close event can fire after close due to timeout HOT 1
- Link: do not render `<p>` HOT 2
- Unable to resolve *.js imports HOT 1
- Support minCount in TextArea component HOT 1
- Clean up accessibility warnings
- DataTable sort function return type is restricted to -1, 0 or 1 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from carbon-components-svelte.