Skip to content

Commit 422daa6

Browse files
committed
working dropdown
1 parent c2ac151 commit 422daa6

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

src/app/client-tractor/client-tractor.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ <h4>
1818
<div>
1919
<span *ngFor="let i of [].constructor(tractor.stars)" class="tractor-container-dropdown-item-rate"> &#x2B50;</span>
2020
</div>
21-
<button class="btn-tractor-buy" style="width:100%">Buy Now!</button>
21+
<button class="btn-ng-dropdown btn-tractor-buy" style="width:100%">Buy Now!</button>
2222
</div>
2323
</ng-template>
2424
</app-my-selector>

src/app/client-tractor/client-tractor.component.sass

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,27 @@
22
width: 150px
33
height: 100px
44
vertical-align: middle
5+
6+
.btn-ng-dropdown
7+
display: inline-block
8+
font-weight: 400
9+
text-align: center
10+
white-space: nowrap
11+
vertical-align: middle
12+
user-select: none
13+
border: 1px solid transparent
14+
padding: 0.375rem 0.75rem
15+
font-size: 1rem
16+
line-height: 1.5
17+
border-radius: 0.25rem
18+
&:not(:disabled):not(.disabled)
19+
cursor: pointer
20+
21+
.btn-tractor-buy
22+
color: #fff
23+
background-color: #dc3545
24+
border-color: #dc3545
25+
&:hover
26+
color: #fff
27+
background-color: #c82333
28+
border-color: #bd2130

src/app/my-selector/my-selector.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@ export class MySelectorComponent<T extends { name: string }> {
2929
selectOption(option: T) {
3030
this.picked = option;
3131
this.selectionChanged.emit(option);
32+
this.isDropDownOpen = !this.isDropDownOpen;
3233
}
3334
}

0 commit comments

Comments
 (0)