Commit f97df64
Simplify close handlers using nullish coalescing
Replace duplicated conditional logic in onKeydown and handleClickOutside with optional chaining and nullish coalescing. Compute name = pg?.name ?? selectedGroupName.value, assign it to searchText, and only update selectedGroupName when a matching project group exists. This makes the code more concise and preserves the previously selected group name instead of clearing searchText when no matching group is found.1 parent 2440434 commit f97df64
1 file changed
Lines changed: 6 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
251 | 248 | | |
252 | 249 | | |
253 | 250 | | |
| |||
256 | 253 | | |
257 | 254 | | |
258 | 255 | | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
265 | 259 | | |
266 | 260 | | |
267 | 261 | | |
| |||
0 commit comments