Skip to content

Commit ba8ba66

Browse files
fix: Correct version selector to show current version as selected
Fix version selector dropdown to properly select the currently displayed version by comparing version objects instead of comparing version name with current_version string. Changed comparison from `item.name == current_version` to `item == current_version` to properly match the current version object. Now: - v3.12.2 page shows v3.12.2 as selected - master page shows master as selected 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 4bb3a7b commit ba8ba66

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

docs/_templates/versioning.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<div class="version-dropdown" style="margin-bottom: 1rem;">
55
<select onchange="window.location.href = this.value" style="width: 100%; padding: 0.5rem; border: 1px solid var(--color-background-border); border-radius: 0.25rem; background-color: var(--color-background-secondary); color: var(--color-foreground-primary); font-size: var(--font-size--small); cursor: pointer;">
66
{% for item in versions %}
7-
<option value="{{ item.url }}" {% if item.name == current_version %}selected{% endif %}>
8-
{{ item.name }}{% if item.name == current_version %} (current){% endif %}
7+
<option value="{{ item.url }}" {% if item == current_version %}selected{% endif %}>
8+
{{ item.name }}{% if item == current_version %} (current){% endif %}
99
</option>
1010
{% endfor %}
1111
</select>

0 commit comments

Comments
 (0)