rob-balfre / svelte-select

Svelte Select. A select component for Svelte
https://svelte-select-examples.vercel.app
Other
1.26k stars 175 forks source link

overflow issue #391

Closed doki97 closed 2 years ago

doki97 commented 2 years ago

When using overflow:hidden on the container like: <Select containerStyles="overflow:hidden"/> to cut off exceeding text from the input, the list dropdown with the options will also be hidden. Is there any other way to cut out exceeding text from the Input ? I tried listAutoWidth={false} as well as puttinginputStyles="text-overflow: ellipsis; white-space: nowrap; overflow: hidden;"

Thanks in advance

jdromero88 commented 2 years ago

if i understand correctly you want to achieve this?

image

if this is the case you can do it by adding a class to the select container then styling it using :global

<Select
  containerClasses="myclass"
  placeholder="Select an Authority"
  {items}
></Select>
<style lang="scss">
  :global(.myclass) {
    width: 200px;
  }
</style>
rob-balfre commented 2 years ago

Fixed in v5

https://svelte.dev/repl/a1993624b8a24b29a778228081c053fe?version=3.47.0