Skip to content

Commit

Permalink
fix(dropdown): update error state template for async dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Sabahat Noor Khan committed Oct 31, 2023
1 parent 562d0ce commit 6f59e68
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions core/components/atoms/dropdown/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -429,12 +429,12 @@ export class Dropdown extends React.Component<DropdownProps, DropdownState> {

let errorResult = errorType;

if (optionsLength === 0) {
if (searchTerm === '') {
errorResult = 'DEFAULT';
} else {
errorResult = 'NO_RECORDS_FOUND';
}
if (optionsLength === 0 && searchTerm === '') {
errorResult = 'DEFAULT';
} else if (searchTerm !== '') {
errorResult = 'NO_RECORDS_FOUND';
} else {
errorResult = 'FAILED_TO_FETCH';
}

this.setState({
Expand Down
2 changes: 1 addition & 1 deletion core/components/atoms/dropdown/ErrorTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const ErrorTemplate: React.FC<ErrorTemplateProps> = ({ dropdownStyle, err
className="d-flex flex-column justify-content-center align-items-center"
data-test="DesignSystem-Dropdown--errorWrapper"
>
<Text className="mb-3" weight="strong">
<Text className="text-align-center mb-3" weight="strong">
{errorTitle[errorType]}
</Text>
<Text className="text-align-center mb-6" weight="medium" size="small" appearance="subtle">
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6f59e68

Please sign in to comment.