Comments (8)
Narrowed it further, the issue is related to types/react. It occurs on 18.2.43 but not on version 18.2.42
from theme-toggles.
Awesome!
My temporary workaround was to just give empty placeholder
,onPointerEnterCapture
and onPointerLeaveCapture
values as attributes. This works btw.
I'll try more to get a better solution and raise a PR if I can.
Thanks!
from theme-toggles.
It'd be awesome to get a PR for this. If not, I can work on it in a few weeks.
It'll have to be made to the v4 branch https://github.com/AlfieJones/theme-toggles/tree/v4
I'm planning on getting v5 finished up this summer which is what the main branch is currently showing
from theme-toggles.
Thanks for the info. I'll give it a chance when I find some time.
from theme-toggles.
This issue only occurs for Nextjs 13.5 and not for 13.4. Can someone please look into this?
from theme-toggles.
I'll try to investigate the issue. I doubt this has to do anything with Nextjs, same happens with Vite. If I find a solution I'll open a PR or just post my findings here.
from theme-toggles.
Thanks @oddgr8, this actually helped a lot to find the issue faster.
Based the version diff, it seems that the 18.2.43
version removes the placeholder
from the HTMLAttributes
(see: npm diff --diff=@types/[email protected] --diff=@types/[email protected]
)
I think it comes from this pr: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/67170/commits
I found also this issue that explains the reason I think: DefinitelyTyped/DefinitelyTyped#26736
But this is the cause only for the placeholder
.
For the onPointerEnterCapture
and onPointerLeaveCapture
there is a change in the version 18.2.66
that removes these both from the DOMAttributes
.
(see npm diff --diff=@types/[email protected] --diff=@types/[email protected]
or DefinitelyTyped/DefinitelyTyped@73b5985)
I also found this discussion about it: DefinitelyTyped/DefinitelyTyped#69006
from theme-toggles.
Sure! You can also add the properties back to the declaration if you want:
declare module "react" {
interface HTMLAttributes<T> extends AriaAttributes, DOMAttributes<T> {
placeholder?: string | undefined;
}
interface DOMAttributes<T> {
onPointerEnterCapture?: React.PointerEventHandler<T> | undefined;
onPointerLeaveCapture?: React.PointerEventHandler<T> | undefined;
}
}
from theme-toggles.
Related Issues (11)
- Changing default state of the toggle HOT 4
- "Auto" state HOT 3
- Change prefers-reduced-motion media query to no-preference HOT 1
- Checkbox can't be used with keyboard HOT 1
- False claims about accessibility. HOT 3
- V5 Feedback
- dyamic ID babel plugin breaks hex colours HOT 1
- Animation bugs when more than one toggle HOT 2
- Div is not working. HOT 4
- System state 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 theme-toggles.