Skip to content
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
5 changes: 3 additions & 2 deletions assets/js/changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,13 @@ function renderHero(hero, stats) {
function renderFilters(releases) {
const allLabel = window.MKSSiteI18n?.get('filters.all', 'all');
const tags = [allLabel, ...new Set((releases || []).map(item => item.tag).filter(Boolean))];
const searchPlaceholder = (window.MKSSiteI18n?.get('changelog.search', 'Search changelog...') || 'Search changelog...') + ' (/)';
const searchLabel = window.MKSSiteI18n?.get('changelog.search', 'Search changelog...') || 'Search changelog...';
const searchPlaceholder = searchLabel + ' (/)';

return `
<section class="section change-filter-shell">
<div class="change-filters panel glass" data-change-filters>
<input class="change-search" type="search" placeholder="${escapeHtml(searchPlaceholder)}" aria-label="${escapeHtml(searchPlaceholder)}" data-change-search>
<input class="change-search" type="search" placeholder="${escapeHtml(searchPlaceholder)}" aria-label="${escapeHtml(searchLabel)}" data-change-search>
<div class="change-filter-list">
${tags.map((tag, index) => `
<button class="change-filter ${index === 0 ? 'active' : ''}" type="button" data-filter="${escapeHtml(tag)}" aria-pressed="${index === 0 ? 'true' : 'false'}">
Expand Down
5 changes: 5 additions & 0 deletions assets/js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,11 @@
}

if (e.key === 'Escape' && isInput) {
var isSearchInput = active.matches('[data-example-search], [data-change-search], input[type="search"]');
if (isSearchInput && active.value) {
active.value = '';
active.dispatchEvent(new Event('input', { bubbles: true }));
}
active.blur();
}
} catch (err) {}
Expand Down
Loading