Skip to content

Commit bfb4ea0

Browse files
committed
Merge branch 'main' into geospatialem/feat-consistent-focus
2 parents 613e1af + a711bb7 commit bfb4ea0

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Presented at the 2025 Esri Developer Summit by Kelly Hutchins and Kitty Hurley o
1616
- Provide a consistent focus order throughout your UI supporting WCAG's [2.4.3: Focus Order](https://www.w3.org/WAI/WCAG22/Understanding/focus-order.html) and [3.2.3: Consistent Navigation](https://www.w3.org/WAI/WCAG22/Understanding/consistent-navigation.html) Success Criterion.
1717
4. [High Contrast](demos/high-contrast/index.html)
1818
- Explore contrast with your data, altering the basemap and layer effects to support the map's purpose when a user has enabled high contrast on their operating system, also supporting WCAG's [1.4.3: Contrast Minimum](https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum) Success Criterion.
19-
5. [Reduced MotioN](demos/reduced-motion/index.html)
19+
5. [Reduced Motion](demos/reduced-motion/index.html)
2020
- Support reduced motion when a user has enabled reduced motion, or disabled animations on their operating system, also supporting WCAG's [2.3.3: Animation from Interactions](https://www.w3.org/WAI/WCAG22/Understanding/animation-from-interactions.html) Success Criterion.
2121

2222
## Resources

demos/expand-component/app.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,19 @@ require([
1717
// Resource: https://developers.arcgis.com/javascript/latest/watch-for-changes/#watch-for-changes-in-the-api
1818
mapEl.addEventListener("arcgisViewReadyChange", () => {
1919
reactiveUtils.watch(() => mapEl.view.popup.visible, (visible) => {
20+
// Wait for the popup to display and set its focus
21+
// Also... wait for the popup to close to set the arcgis-search focus
2022
if (mapEl.view.popup.visible) {
2123
setTimeout(() => {
2224
mapEl.view.popup.focus();
23-
}, 100);
25+
}, 500);
2426
} else {
2527
searchEl.focusSearch();
2628
}
2729
}
2830
);
2931
});
3032

31-
3233
// Initialize the mutation observer
3334
// Resource: https://developers.arcgis.com/javascript/latest/watch-for-changes/#using-a-mutation-observer
3435
const observer = new MutationObserver((mutations, observer) => {
@@ -59,6 +60,7 @@ require([
5960
lightModeCss.disabled = isDarkMode;
6061
toggleModeEl.icon = isDarkMode ? "moon" : "brightness";
6162
document.body.className = isDarkMode ? "calcite-mode-dark" : "";
63+
mapEl.basemap = isDarkMode ? "dark-gray" : "gray";
6264

6365
document.querySelectorAll(`.calcite-mode-${isDarkMode ? "light" : "dark"}`).forEach(node =>
6466
node.classList.replace(`calcite-mode-${isDarkMode ? "light" : "dark"}`, `calcite-mode-${mode}`)

demos/expand-component/style.css

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,17 @@ calcite-shell-panel[slot="panel-start"] calcite-panel {
2121

2222
/* Custom styling using Calcite's semantic tokens */
2323
/* Resource: https://developers.arcgis.com/calcite-design-system/foundations/tokens/usage */
24-
:root,
24+
25+
/* Light mode */
26+
body,
2527
:focus {
2628
--calcite-color-brand: #000;
2729
--calcite-color-focus: var(--calcite-color-brand);
30+
}
31+
32+
/* Dark mode */
33+
body.calcite-mode-dark,
34+
.calcite-mode-dark :focus {
35+
--calcite-color-brand: #FEFE4D;
36+
--calcite-color-focus: var(--calcite-color-brand);
2837
}

0 commit comments

Comments
 (0)