Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
285 views
in Technique[技术] by (71.8m points)

css - What is the correct way to place each option of a ngx-bootstrap-multiselect on it's own row?

I just upgraded an Angular 8 project to Angular 9 and I'm trying out ngx-bootstrap-multiselect.

The way the items are placed on one line creates for a wonky display (where sometimes checkbox for subsequent items are displayed to the right of the preceding item).

enter image description here

Is there a setting that directly controls this? If not, what's the recommended alternative (I'm thinking of using itemClasses).

question from:https://stackoverflow.com/questions/65829954/what-is-the-correct-way-to-place-each-option-of-a-ngx-bootstrap-multiselect-on-i

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Based on @Justinas comment, I was able to get the items to display correctly by adding this to the parent component css file:

::ng-deep span[role="menuitem"]{
    display: block;
}

enter image description here

The component still exhibits some strange behavior. When a single item is clicked, every item is selected: enter image description here

I think it is due to the fact that the component requires Bootstrap 4 (I am on Bootstrap 3). Related thread here: https://github.com/softsimon/ngx-bootstrap-multiselect/issues/462#issuecomment-560370149


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...