Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sl-input should create fewer native input elements #1977

Open
justinfagnani opened this issue Apr 12, 2024 · 1 comment
Open

sl-input should create fewer native input elements #1977

justinfagnani opened this issue Apr 12, 2024 · 1 comment
Labels
bug Things that aren't working right in the library.

Comments

@justinfagnani
Copy link
Contributor

Describe the bug

sl-input creates two helper inputs to use native input date and number parsing. Inputs are farily heavyweight as far as elements go, and many sl-input instances might never be of type date or number, and so never need or use these helpers.

The helpers should probably be created lazily, and they don't need to be instance properties. One helper can be shared across all sl-input instances.

To Reproduce

See

private __numberInput = Object.assign(document.createElement('input'), { type: 'number' });

Demo

n/a

Screenshots

n/a

Browser / OS

all

Additional information

n/a

@justinfagnani justinfagnani added the bug Things that aren't working right in the library. label Apr 12, 2024
@KonnorRogers
Copy link
Collaborator

hmmm...solid point about lazy eval and only constructing 1 instance for all elements. It's a pretty quick change to make as we can move to getters, let me put together a PR real quick and see if anything breaks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Things that aren't working right in the library.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants