Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(rum-explorer): changes input event to keydown-enter for the filter input field #678

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion tools/oversight/elements/facetsidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default class FacetSidebar extends HTMLElement {
const filterInput = document.createElement('input');
filterInput.type = 'text';
filterInput.id = 'filter';
filterInput.placeholder = 'Type to filter...';
filterInput.placeholder = 'Type to filter, press ↵ to apply';
quickFilter.append(filterInput);
this.append(quickFilter);

Expand Down
9 changes: 8 additions & 1 deletion tools/oversight/slicer.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@
));

if (cp === 'loadresource') {
console.log('adding histogram facet');

Check warning on line 245 in tools/oversight/slicer.js

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement
// loadresource.target are not discrete values, but the number
// of milliseconds it took to load the resource, so the best way
// to present this is to create a histogram
Expand Down Expand Up @@ -431,7 +431,14 @@
loadData(elems.viewSelect.value).then(draw);
}

elems.filterInput.addEventListener('input', () => {
elems.filterInput.addEventListener('keydown', (event) => {
if (event.key === 'Enter') {
updateState();
draw();
}
});

elems.filterInput.addEventListener('blur', () => {
updateState();
draw();
});
Expand Down
2 changes: 1 addition & 1 deletion tools/rum/elements/facetsidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default class FacetSidebar extends HTMLElement {
const filterInput = document.createElement('input');
filterInput.type = 'text';
filterInput.id = 'filter';
filterInput.placeholder = 'Type to filter...';
filterInput.placeholder = 'Type to filter, press ↵ to apply';
quickFilter.append(filterInput);
this.append(quickFilter);
const facetsElement = document.createElement('aside');
Expand Down
9 changes: 8 additions & 1 deletion tools/rum/slicer.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,14 @@ const io = new IntersectionObserver((entries) => {
loadData(elems.viewSelect.value).then(draw);
}

elems.filterInput.addEventListener('input', () => {
elems.filterInput.addEventListener('keydown', (event) => {
if (event.key === 'Enter') {
updateState();
draw();
}
});

elems.filterInput.addEventListener('blur', () => {
updateState();
draw();
});
Expand Down
Loading