PeterStaev / NativeScript-Drop-Down

A NativeScript DropDown widget.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

css class must be a binding (possible documentation needed?)

jdmcnair opened this issue · comments

It appears on first blush, after playing around a bit with the class attribute, that the value must be a binding to actually be applied to the element itself and the child elements. Is this the intended behavior? If it is the intended behavior, it may be worth an explanatory line or two in the documentation. If it's not the intended behavior, is there a bug?

Hey @jdmcnair , that is a wrong assumption. I've just tested the demo app and the class attribute works just as it does on any other NativeScript control - i.e. it can be either binding or simple attribute value.

Hi @PeterStaev, thanks for having a look. Just to clarify what I'm seeing, it looks like both of these work:

<DropDown #dd [class]="someBoundPropertyWithClassName"></DropDown>
<DropDown #dd [class]="'some-class-name'"></DropDown>

But the following does not cause the class to be applied to the dropdown and its child selections:

<DropDown #dd class="some-class-name"></DropDown>

Are you saying you just tried this third method of applying a class, and it actually does work? If so, maybe I need to try something different.

That is correct. I changed in the demo app [class]="cssClass" to class="default" and the control is styled correctly.

No further response so closing this one for now. In case you still have problems, please provide more details.