Replies: 1 comment 1 reply
-
Hey, thanks for the investigation! The |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Would love to integrate this in some of my current projects, but many use preact. There are a few outstanding issues though
Component mount:
There is a call to
this.attachShadow({ mode: "open" })
herenumber-flow/packages/number-flow/src/index.ts
Line 93 in 366217d
If we make this conditional on
!this.shadowRoot
, the component mounts.Trend (auto)
We run into an issue with
trend
. Leavingtrend
on default, the transition from 9 -> 10 loops the last digit through 8, 7, ..., 1, 0 - instead of the correct behaviour of simply going from 9 to 0.Steps to reproduce:
pnpm create vite@latest number-flow-test # select preact. typescript pnpm i @number--flow/react
Add this code to the homepage:
HMR
There is another issue with HMR.
customElements.define
may be called after already having defined the custom element. The steps to reproduc this are:<NumberFlow />
element and save the file.<NumberFlow />
element and save.This error is produced:
So it looks like we need to check if the custom element has already been defined before calling
define
I have not worked with custom elements before, but I could potentially look into these issues in the coming couple of weeks.
Thanks again for the library.
Beta Was this translation helpful? Give feedback.
All reactions