mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 01:58:53 +01:00
Use optional chaining for more method calls (#156938)
This rewrites code such as:
```ts
if (thing) {
thing.method();
}
```
To the more concise:
```ts
thing?.method();
```
This was done using a simple find replace. I tried to keep the change pretty conservative so it only touches simple cases like above
This commit is contained in:
@@ -1149,9 +1149,7 @@ export function removeTabIndexAndUpdateFocus(node: HTMLElement): void {
|
||||
// in the hierarchy of the parent DOM nodes.
|
||||
if (document.activeElement === node) {
|
||||
const parentFocusable = findParentWithAttribute(node.parentElement, 'tabIndex');
|
||||
if (parentFocusable) {
|
||||
parentFocusable.focus();
|
||||
}
|
||||
parentFocusable?.focus();
|
||||
}
|
||||
|
||||
node.removeAttribute('tabindex');
|
||||
|
||||
Reference in New Issue
Block a user