Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ export const MultiSelectContainer = styled.div`
height: 100%;
display: flex;
align-items: center;
fill: ${Colors.SLATE_GRAY};
}
.rc-select-arrow-icon {
&::after {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const FUSE_OPTIONS = {
};

const SingleDropDown = Select.ofType<DropdownOption>();
const StyledSingleDropDown = styled(SingleDropDown)`
const StyledSingleDropDown = styled(SingleDropDown)<{ isSelected: boolean }>`
div {
flex: 1 1 auto;
}
Expand Down Expand Up @@ -60,6 +60,8 @@ const StyledSingleDropDown = styled(SingleDropDown)`
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
color: ${(props) =>
props.isSelected ? Colors.SELECT_COLOR : Colors.SELECT_PLACEHOLDER};
}
&& {
.${Classes.ICON} {
Expand Down Expand Up @@ -171,6 +173,11 @@ class DropDownComponent extends React.Component<DropDownComponentProps> {
className={this.props.isLoading ? Classes.SKELETON : ""}
disabled={this.props.disabled}
filterable={this.props.isFilterable}
isSelected={
!_.isEmpty(this.props.options) &&
this.props.selectedIndex !== undefined &&
this.props.selectedIndex > -1
}
itemListPredicate={
!this.props.serverSideFiltering
? this.itemListPredicate
Expand Down Expand Up @@ -202,7 +209,7 @@ class DropDownComponent extends React.Component<DropDownComponentProps> {
this.props.selectedIndex !== undefined &&
this.props.selectedIndex > -1
? this.props.options[this.props.selectedIndex].label
: "-- Select --"
: this.props.placeholder || "-- Select --"
}
/>
</StyledSingleDropDown>
Expand Down
2 changes: 2 additions & 0 deletions app/client/src/constants/Colors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,7 @@ export const Colors = {
BOX_SHADOW_DEFAULT_VARIANT4: "rgba(0, 0, 0, 0.25)",
BOX_SHADOW_DEFAULT_VARIANT5: "rgba(0, 0, 0, 0.25)",
SELECT_DISABLED: "#ced9e080",
SELECT_PLACEHOLDER: "#bfbfbf",
SELECT_COLOR: "#182026",
};
export type Color = typeof Colors[keyof typeof Colors];
9 changes: 9 additions & 0 deletions app/client/src/widgets/DropdownWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ class DropdownWidget extends BaseWidget<DropdownWidgetProps, WidgetState> {
},
dependencies: ["selectionType"],
},
{
propertyName: "placeholderText",
label: "Placeholder",
controlType: "INPUT_TEXT",
placeholderText: "Enter placeholder text",
isBindProperty: true,
isTriggerProperty: false,
validation: { type: ValidationTypes.TEXT },
},
{
propertyName: "isFilterable",
label: "Filterable",
Expand Down