cirykpopeye / selectra Goto Github PK
View Code? Open in Web Editor NEWSelect plugin alternative to Select2 Vanilla JS
Home Page: https://cirykpopeye.github.io/selectra
Select plugin alternative to Select2 Vanilla JS
Home Page: https://cirykpopeye.github.io/selectra
To show it's a dropdown, add an icon on the right for both the button and the input
For me it would esp. be helpful to change the Popper placement
to something different than bottom-start
.
I have not found any way (ie. hack) to access the Popper instance afterwards to change it.
Another possibility would be to expose SelectraElement
so that one could access its attributes.
Some comments:
:focus-visible
instead of :focus
for the keyboard navigation focus states.mousedown
. This is fine, but you should support the quickselect action that's a part of the w3c spec for select boxes (mouse down to open, drag to the option you desire, mouse up to select that option and close the dropdown)Hi,
I'm using selectra like so :
import { createSelectra } from 'selectra';
const selects = document.querySelectorAll('.custom-select');
selects.forEach((select) => {
createSelectra(select);
});
On your demo, it doesn't work on safari for the first select "Gender" either : https://cirykpopeye.github.io/selectra/
Safari v15.4
MacOs 12.3.1
Would appreciate help please !
Make it possible to use instead of calling usual selects.
Hi,
When trying to import the library like so :
import Selectra from 'selectra';
I'm having this message :
export 'default' (imported as 'Selectra') was not found in 'selectra' (possible exports: createSelectra)
Can you add the class as default export as well as createSelectra please ?
Thanks
Trigger events on change / update, see which other events are useful
Because you are using raw HTML to construct the options this may break if you have an option value with ">" character in it, or a label if you haven't escaped properly. There lots of other places in the code that could have the same problem.
Options are added one by one to the DOM, which causes a layout + reflow for every single option added. For performance, you should make use of a DocumentFragment.
If hover over multiple option that is already selected, show a trash icon on the right
selectra.min.js
contains the following hint at the top:
ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
This devtool is neither made for production nor for readable output files.
Is this intended or was there maybe an option missing while packing?
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.