Skip to content

Commit 0f340ae

Browse files
committed
Adding scroll to initial tag list
1 parent 85041c2 commit 0f340ae

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

scss/global.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ body.light-theme {
4242
color: $gray-800;
4343
background: $white;
4444
width: 100%;
45+
overflow: auto;
46+
max-height: 200px;
47+
z-index: 2;
4548
}
4649

4750
.react-autosuggest__suggestions-list {

src/display/views/tools/components/ManageTagsPane.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const ManageTagsPane = (props) => {
3737
const inputLength = inputValue.length;
3838
let filteredSuggestions = [];
3939
if (inputLength === 0) {
40-
filteredSuggestions = tags.sort().slice(0, 10);
40+
filteredSuggestions = tags.sort();
4141
} else {
4242
filteredSuggestions = tags.filter(tag => tag.toLowerCase().includes(inputValue)).sort();
4343
}

src/display/views/tools/components/__tests__/ManageTagsPane.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ describe('behavior', () => {
5757
expect(submitEvent.preventDefault).toHaveBeenCalledTimes(1);
5858
});
5959
describe('onSuggestionsFetchRequested', () => {
60-
it('should return ten sorted values when no input', () => {
60+
it('should return sorted values when no input', () => {
6161
const tags = [
6262
'tagb', 'tag7', 'tag9', 'tag4', 'tag2', 'tag5', 'tag1', 'tag3', 'tag6', 'tag8', 'taga'
6363
];
@@ -66,9 +66,9 @@ describe('behavior', () => {
6666
autosuggest.props().onSuggestionsFetchRequested({ value: '' });
6767
element.update();
6868
autosuggest = getSpecWrapper(element, 'manage-tags-autosuggest');
69-
expect(autosuggest.props().suggestions).toHaveLength(10);
69+
expect(autosuggest.props().suggestions).toHaveLength(11);
7070
expect(autosuggest.props().suggestions).toEqual(
71-
['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6', 'tag7', 'tag8', 'tag9', 'taga']
71+
['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6', 'tag7', 'tag8', 'tag9', 'taga', 'tagb']
7272
);
7373
});
7474
it('should return case-insensitive matching values when input', () => {

0 commit comments

Comments
 (0)