bemto / bemto-input Goto Github PK
View Code? Open in Web Editor NEWComplex input foundation based on bemto-components & styled-components
License: MIT License
Complex input foundation based on bemto-components & styled-components
License: MIT License
It seems that there can be various issues with it, I wonder if we can re-implenent it by calling .focus()
on the controller on componentDidUpdate
if the autoFocus
prop is present (while not rendering it in the html)
Right now the font-size is inherited. However, there is a chance its better to make it 16px, in order for it to never be smaller by default.
Though, there are also other issues with everything for the font to be inherited, like for serif fonts its unlikely we'd want to have inputs with serif fonts as well?
However, probably all of that shouldn't be changed, thus being less opinionated. But if so, the mention of the font-size issue could be added to styling notes.
There is an obscure behavior in iOS where if we have an input inside a scrollbox, then scrolling the page by starting the drag from the input element would scroll the topmost scrollbox instead of a target one. This can be sometimes be fixed by adding -webkit-overflow-scrolling: touch;
on the scrollbox, but this fix can introduce more bugs if the scrollbox is positioned inside the iframe.
We can somewhat fix this by hiding the input's controller from the events using pointer-events: none;
, but only while the input is not focused. As we always have a wrapping label in our implementation, it won't interfere with anything for iOS, and we can ensure this won't affect desktop by wrapping the fix in pointer
@media
.
The fix would look then like this:
@media (pointer: coarse) {
&:not(&_focus) &__Controller {
pointer-events: none;
}
}
We need to test some more edge-cases, but for now this should work.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.