Giter Club home page Giter Club logo

Comments (5)

metonym avatar metonym commented on May 13, 2024

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.

metonym avatar metonym commented on May 13, 2024

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.

dm-de avatar dm-de commented on May 13, 2024

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.

dm-de avatar dm-de commented on May 13, 2024

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.

metonym avatar metonym commented on May 13, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.