combobox-custom-test
Version:
Combobox custom test
153 lines (135 loc) • 2.91 kB
CSS
.search-container {
display: flex;
flex-direction: column;
position: relative;
font-family: Arial, Helvetica, sans-serif;
}
.search-container.outlined {
border: 2px solid #ccc;
border-radius: 4px;
background-color: #fff;
}
.search-container.outlined.outlined-active {
border-color: #2196f3;
background-color: #fff;
}
.dropdown {
position: relative;
width: 100%;
}
.selected-options-container {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 5px;
max-height: 100px;
overflow-y: auto;
padding-right: 30px;
}
.selected-option {
display: flex;
align-items: center;
background-color: #F0F3F2;
color: '#333';
border-radius: 20px;
padding: 3px 8px;
margin: 2px;
font-size: 14px;
position: relative;
}
.remove-icon {
margin-left: 5px;
cursor: pointer;
font-size: 14px;
color: #666;
}
.dropdown-trigger {
display: flex;
align-items: center;
width: 100%;
height: auto;
min-height: 40px;
padding: 5px 10px;
color: #333;
background-color: #fff;
border: 1px solid #ccc;
border-radius: 0px;
box-sizing: border-box;
cursor: pointer;
font-size: 14px;
position: relative;
}
.dropdown-trigger.outlined-active {
border-color: #2196f3;
background-color: #fff;
}
.dropdown-trigger .dropdown-icon {
position: absolute;
right: 10px;
font-size: 14px;
color: #666;
margin-right: 6px;
}
.dropdown-list {
position: absolute;
top: 100%;
left: 0;
margin-top: 6px;
width: 100%;
max-height: 300px;
overflow-y: auto;
border: 1px solid #ccc;
border-radius: 0px;
background-color: #fff;
z-index: 1001; /* Ensure dropdown list appears on top */
box-sizing: border-box;
box-shadow: 6px 6px 10px #d9d9d9;
}
.search-input-container {
position: relative;
width: 100%;
}
.search-input {
width: 100%;
height: 40px;
border: 1px solid #E1E1E1;
border-radius: 0px;
padding-left: 45px;
padding-right: 30px;
color: #333;
background-color: #fff;
outline: none;
box-sizing: border-box;
font-size: 14px;
}
.search-icon {
position: absolute;
top: 50%;
left: 14px;
transform: translateY(-50%);
color: #a6a6a6;
font-size: 18px;
}
.clear-icon {
position: absolute;
top: 50%;
right: 10px;
transform: translateY(-50%);
color: #a6a6a6;
font-size: 14px;
cursor: pointer;
margin-right: 8px;
}
.dropdown-item {
padding: 8px 8px 8px 14px;
cursor: pointer;
color: #333;
font-size: 14px;
}
.dropdown-item:hover {
background-color: #ECFAF7;
}
.highlight {
background-color: #1DBFBD;
color: #000;
}