Select size

Get help with using Metro 4 components
Post Reply
Alban
Posts: 2
Joined: Wed Oct 24, 2018 12:15 am
Status: Offline

Select size

Post by Alban » Wed Oct 24, 2018 12:22 am

Hello,

How is it possible to set specific size for Select ?
data-size="xxx" doesn't work.


Thanks.

User avatar
olton
Site Admin
Posts: 121
Joined: Mon Apr 09, 2018 6:19 pm
Location: Kiev, Ukraine
Status: Offline

Post by olton » Wed Oct 24, 2018 12:28 am

Put select into container with required size

Alban
Posts: 2
Joined: Wed Oct 24, 2018 12:15 am
Status: Offline

Post by Alban » Wed Oct 24, 2018 12:35 am

Hello,

I haven't got problem with Input, but for Select i tried

Code: Select all

<select data-role="select" data-size="400">
        <option value="test">Test</option>
</select>
but it doesn't work.

User avatar
olton
Site Admin
Posts: 121
Joined: Mon Apr 09, 2018 6:19 pm
Location: Kiev, Ukraine
Status: Offline

Post by olton » Wed Oct 24, 2018 1:00 am

Select have not option size and attribute data-size, read docs

sputnikhemp
Posts: 1
Joined: Fri Oct 26, 2018 4:56 am
Status: Offline

Post by sputnikhemp » Fri Oct 26, 2018 5:27 am

You can do that with jQuery.
Here is an example: https://i.imgur.com/a5oNVaT.png

User avatar
olton
Site Admin
Posts: 121
Joined: Mon Apr 09, 2018 6:19 pm
Location: Kiev, Ukraine
Status: Offline

Post by olton » Fri Oct 26, 2018 1:18 pm

Code: Select all

<style>
  .my-select-size {
    width: 400px;
  }
</style>

<select data-role="select" data-cls-select="my-select-size">
...
</select>

Post Reply