Skip to content

Commit

Permalink
TNO-3017 auto complete search field (#2363)
Browse files Browse the repository at this point in the history
* TNO-3017 changes to UI to add select drop down with reports

* TNO-3017 adding dorpdown to select the report to add stories to.

* TNO-3017 fixed linting errors

* TNO-3017 changes to input field for sections search

* Changes to add search icon to sections

* TNO-3017 Add Serach field for Sections

* MMI-3017 changes to add scroll bar and clear search after section selected.

* MMI-3017 changes to css class to remove orizontal scroll on saving
  • Loading branch information
nehalaggarwal-bcgov authored Dec 16, 2024
1 parent fe615be commit 932bedc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 2 additions & 0 deletions app/subscriber/src/components/tool-bar/AddToReportMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,12 @@ export const AddToReportMenu: React.FC<IAddToReportMenuProps> = ({ content, onCl
</div>
));
onClear?.();
setSearchQuery('');
} catch {
// Errors are handled globally.
} finally {
setInProgress({ sectionName: '', value: false });
setSearchQuery('');
}
},
[addContentToReport, onClear, getReport, generateReport],
Expand Down
14 changes: 10 additions & 4 deletions app/subscriber/src/components/tool-bar/styled/AddToMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const AddToMenu = styled.div`
}
.report-name {
margin-left: 1.5em;
flex: auto;
}
.react-tooltip {
font-size: 1.1em;
Expand All @@ -39,10 +40,11 @@ export const AddToMenu = styled.div`
color: ${(props) => props.theme.css.btnBkPrimary};
font-weight: bold;
border-bottom: 1px solid ${(props) => props.theme.css.btnBkPrimary};
}
.active-section {
position: absolute;
left: 2.85em;
.active-section {
position: sticky;
border-bottom: none;
margin-left: -1.8em;
}
}
margin-left: 3.5em;
&:not(:hover) {
Expand Down Expand Up @@ -85,4 +87,8 @@ export const AddToMenu = styled.div`
color: ${(props) => props.theme.css.iconPrimaryColor};
}
}
.section-list {
max-height: 50vh;
overflow-y: auto;
overflow-x: hidden;
`;

0 comments on commit 932bedc

Please sign in to comment.