Comments (4)
@ahstro I created one today, feel free to use it
from react-input-autosize.
Thanks @twobit but I can't get it to work.
To get the declarations to be recognized at all I had to wrap them in a
declare module 'react-input-autosize' { ... }
But then I get the the type error:
[ts]
Type '{ type: "text"; className: string; spellCheck: false; value: ReactText; onChange: (ev: FormEvent<...' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; ...'.
Type '{ type: "text"; className: string; spellCheck: false; value: ReactText; onChange: (ev: FormEvent<...' is not assignable to type 'Readonly'.
Types of property 'value' are incompatible.
Type 'ReactText' is not assignable to type 'string | undefined'.
Type 'number' is not assignable to type 'string | undefined'.
from react-input-autosize.
I just created a new NPM module which calculates width of text it works perfect with input and Typescript please check it out:
- 252 byte size only 10% of
react-input-autosize
(2.3KB)
https://github.com/ozluy/calculate-text-width
from react-input-autosize.
You can use @types/react-input-autosize
, but hey, it's always better for it to be included in the actual package :)
from react-input-autosize.
Related Issues (20)
- add ref for sizer div for width queries HOT 1
- MinWidth is set to 1 even placeholder is passed down
- Modify styling for :focus and ::placeholder HOT 2
- Update width on viewport resize HOT 1
- Input auto focus property not working
- npm error
- componentWillReceiveProps is deprecated HOT 2
- Failed to load config "keystone-react" to extend from* HOT 2
- How do you style the inner input? HOT 2
- Old prop-types version references bad node-fetch version
- React 17 support HOT 3
- Size isn't computed properly with custom fonts
- Does not update when input element is hidden on first render
- Width is not calculated correctly on font-size change HOT 2
- package-lock.json in repo is not in sync with package.json HOT 1
- Error: Cannot find module 'babel-preset-env' HOT 4
- [bug] input autosize not working with decimals and comma HOT 1
- [bug] css variables
- Passing ref to AutoSizeInput Component HOT 2
- Update for React 18 support HOT 3
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 react-input-autosize.