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

Listbox size initialize #78

Open
nicolasQbt opened this issue Nov 22, 2013 · 2 comments
Open

Listbox size initialize #78

nicolasQbt opened this issue Nov 22, 2013 · 2 comments

Comments

@nicolasQbt
Copy link

In listbox.rb line 36 in initialize

@properties[ :size ] = 1

should be :

@properties[ :size ] = list.length

If I create a list with 2 items, I have to set the size to 2 like this :

listbox.size = 2

otherwise I can't set the multiple= to true because :

if value && self.size < 2
    raise( ArgumentError,
         'Can only select multiple when size is greater than 1.' )
end
@thomthom
Copy link
Owner

That's intended, as when size is 1 the list is a dropdown list.

I guess that size might not be the best property to set it, but it directly links to the size property of SELECT elements in HTML. I'm not sure if the size attribute is really strictly enforced - as in, if you set the height then it will display as many items as possible.

So maybe there should be two classes here. One for dropdown lists and one for "normal" lists.

?

@nicolasQbt
Copy link
Author

Maybe the two class is the good solution. For the moment, I force the size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants