slim-select icon indicating copy to clipboard operation
slim-select copied to clipboard

Making Select Field Required

Open ATOPBIO opened this issue 4 years ago • 5 comments

Hello, when using slim-select with a required

Is there a workaround for this?

ATOPBIO avatar Apr 14 '21 22:04 ATOPBIO

Having the same issue

ChipRyan avatar May 07 '21 11:05 ChipRyan

Try this one

select[data-ssid] {
  pointer-events: none;
  opacity: 0;
  display: flex !important;
  position: absolute;
}

demmmmios avatar May 19 '21 14:05 demmmmios

This should be added to the core stylesheet.

columbian-chris avatar Jul 30 '21 13:07 columbian-chris

To add on top of this:

Is it possible for slim-select to just use opacity: 0 on the select input field rather than set style=display:none? I notice I'd have to set

.ss-main {
  display: flex !important;
};

on top of @demmmmios solution here in the case where I call an AJAX request (using HTMX) to change the content inside of the select options so the ss-main doesn't disappear after loading the new DOM content.

bennpham avatar Nov 02 '21 18:11 bennpham

I think this project is no longer in development, or maybe i am wrong, but look on issues and last release tag :(

demmmmios avatar Nov 09 '21 21:11 demmmmios

Hey everyone. Sorry for not replying on this. I released a new version of slim select. As for this issue. Slim select does add display none to the original select. I cant say that just setting the opacity to 0 would be a better option. That being said, once you initiate SlimSelect there is a function couple layers deep you can call.

var slim = new SlimSelect({})
slim.render.showUI()

// Then you can add whatever style you want to it.

Hope this helps. Check out the new version and let me know your thoughts.

brianvoe avatar Nov 21 '22 01:11 brianvoe