Commit c1eaa75
feat: add ignored element support for focus lock (#727)
* feat: add ignored element support for focus lock
Add ability to mark elements as ignored during focus lock, allowing temporary focus on elements outside the locked area.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Update src/Dom/focus.ts
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
* test: add test for ignoreElement functionality
Add a simple test to verify that ignoreElement allows focus on ignored elements outside the locked area.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* refactor: use stable ID as key for ignoredElementMap
Use useId from React hooks as a stable key instead of element reference for the ignoredElementMap. This prevents issues where element reference changes (e.g., during component re-renders) cause the ignore functionality to break.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* refactor: simplify map structure - use id mapping to element
Change from elementToIdMap to idToElementMap for clearer logic: stable ID as key maps to element.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* refactor: simplify isIgnoredElement logic
Simplify the isIgnoredElement function for better readability.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>1 parent 595856a commit c1eaa75
2 files changed
+89
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
102 | 103 | | |
103 | 104 | | |
104 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
105 | 110 | | |
106 | 111 | | |
107 | 112 | | |
108 | 113 | | |
109 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
110 | 137 | | |
111 | 138 | | |
112 | 139 | | |
| |||
116 | 143 | | |
117 | 144 | | |
118 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
119 | 151 | | |
120 | 152 | | |
121 | 153 | | |
| |||
149 | 181 | | |
150 | 182 | | |
151 | 183 | | |
| 184 | + | |
152 | 185 | | |
153 | | - | |
| 186 | + | |
154 | 187 | | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
155 | 191 | | |
156 | 192 | | |
157 | 193 | | |
| |||
166 | 202 | | |
167 | 203 | | |
168 | 204 | | |
| 205 | + | |
| 206 | + | |
169 | 207 | | |
170 | 208 | | |
171 | 209 | | |
| |||
177 | 215 | | |
178 | 216 | | |
179 | 217 | | |
| 218 | + | |
180 | 219 | | |
181 | 220 | | |
182 | 221 | | |
183 | 222 | | |
184 | | - | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
185 | 226 | | |
186 | 227 | | |
187 | 228 | | |
188 | 229 | | |
189 | | - | |
| 230 | + | |
190 | 231 | | |
191 | 232 | | |
192 | | - | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
193 | 243 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
99 | 134 | | |
0 commit comments