91e75e620b
CI: cua-driver distro-compat matrix / debian:12 (glibc 2.36) (push) Has been cancelled
CI: SPDX Headers / Check SPDX headers (warn-only) (push) Has been cancelled
CD: Docs MCP Server / build (linux/amd64) (push) Has been cancelled
CD: Docs MCP Server / build (linux/arm64) (push) Has been cancelled
CD: Docs MCP Server / merge (push) Has been cancelled
CI: cua-driver distro-compat matrix / Resolve release version (push) Has been cancelled
CI: cua-driver distro-compat matrix / fedora:41 (glibc 2.40) (push) Has been cancelled
CI: cua-driver distro-compat matrix / rockylinux:9 (glibc 2.34) (push) Has been cancelled
CI: cua-driver distro-compat matrix / ubuntu:22.04 (glibc 2.35) (push) Has been cancelled
CI: cua-driver distro-compat matrix / ubuntu:24.04 (glibc 2.39) (push) Has been cancelled
CI: cua-driver distro-compat matrix / Distro compat summary (push) Has been cancelled
CI: Rust Linux unit / Rust Linux unit and compile (push) Has been cancelled
CI: Rust Windows unit / Rust Windows unit and compile (push) Has been cancelled
CI: Nix Linux Rust source / Nix / compositor build (push) Has been cancelled
CI: Nix Linux Rust source / Nix / driver package (push) Has been cancelled
CI: Nix Linux Rust source / Nix / Rust unit tests (push) Has been cancelled
56 lines
2.2 KiB
HTML
56 lines
2.2 KiB
HTML
<main class="flex flex-col h-full w-full p-6" role="main" aria-label="Dropdown selection interface">
|
|
<div class="max-w-md mx-auto w-full">
|
|
<h1 class="text-xl font-semibold text-gray-900 mb-6">Select from dropdown</h1>
|
|
|
|
<div class="flex flex-col gap-2">
|
|
<label for="fruit-select" class="text-sm font-medium text-gray-700"> Choose a fruit: </label>
|
|
<select
|
|
id="fruit-select"
|
|
class="px-3 py-2 border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 bg-white text-gray-900"
|
|
aria-label="Fruit selection dropdown"
|
|
>
|
|
<option value="">-- Select a fruit --</option>
|
|
<option value="apple">Apple</option>
|
|
<option value="banana">Banana</option>
|
|
<option value="orange">Orange</option>
|
|
<option value="grape">Grape</option>
|
|
<option value="mango">Mango</option>
|
|
<option value="strawberry">Strawberry</option>
|
|
<option value="watermelon">Watermelon</option>
|
|
</select>
|
|
</div>
|
|
|
|
<!-- Selected Value Display -->
|
|
<div class="mt-6 p-4 border border-gray-300 rounded-lg bg-gray-50">
|
|
<p class="text-sm font-medium text-gray-700 mb-1">Selected:</p>
|
|
<p id="selected-display" class="text-lg text-gray-900 font-semibold">None</p>
|
|
</div>
|
|
|
|
<div class="mt-4 p-3 bg-blue-50 border border-blue-200 rounded">
|
|
<p class="text-sm text-blue-800">
|
|
<iconify-icon icon="mdi:information" class="text-blue-600"></iconify-icon>
|
|
Click the dropdown and select the specified fruit
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
// Store selected value globally for evaluation
|
|
window.__selectedValue = null;
|
|
|
|
const dropdown = document.getElementById('fruit-select');
|
|
const selectedDisplay = document.getElementById('selected-display');
|
|
|
|
// Update the display and global value when selection changes
|
|
dropdown.addEventListener('change', function () {
|
|
const value = this.value;
|
|
window.__selectedValue = value || null;
|
|
|
|
// Update display
|
|
const selectedOption = this.options[this.selectedIndex];
|
|
selectedDisplay.textContent =
|
|
selectedOption.text === '-- Select a fruit --' ? 'None' : selectedOption.text;
|
|
});
|
|
</script>
|
|
</main>
|