diff --git a/examples/plain-html/index.html b/examples/plain-html/index.html index ac119a949..a3122cc7a 100644 --- a/examples/plain-html/index.html +++ b/examples/plain-html/index.html @@ -12,6 +12,7 @@ @@ -99,7 +104,9 @@ const dropdown = document.querySelector('leo-dropdown') const dropdownSelected = document.querySelector('leo-dropdown [slot="value"]') const input = document.querySelector('leo-input') - const segmentedControl = document.querySelector('leo-segmentedcontrol'); + const segmentedControlExample = document.querySelector('#example-segmented-control'); + const segmentedControlToggle = segmentedControlExample.querySelector('leo-toggle'); + const segmentedControl = segmentedControlExample.querySelector('leo-segmentedcontrol'); function updateSelectedOption(e) { for (const radio of radios) @@ -147,6 +154,10 @@ toggleButton.textContent = e.value }) + segmentedControlToggle.addEventListener('change', () => { + segmentedControl.classList.toggle('segmented-control-full') + }) + dialogButton.addEventListener('click', () => { dialog.isOpen = true dialogButton.isDisabled = true @@ -245,16 +256,19 @@ Primary - - - Full - - - - Simple - - - +
+ Toggle segmented control from automatic to parent's width + + + Full + + + + Simple + + + +