forked from microsoft/fluentui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: KHMakoto <[email protected]>
- Loading branch information
Showing
42 changed files
with
1,381 additions
and
110 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/@fluentui-dom-utilities-781d59ca-cc21-4853-8971-45459939f85d.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "minor", | ||
"comment": "feat: add shadow DOM support for DOM APIs", | ||
"packageName": "@fluentui/dom-utilities", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
7 changes: 7 additions & 0 deletions
7
change/@fluentui-react-focus-a8531b74-9b98-4cb7-8806-cae9890d42ed.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "minor", | ||
"comment": "feat: add shadow DOM support when traversing the DOM", | ||
"packageName": "@fluentui/react-focus", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export const getActiveElement = (doc: Document): Element | null => { | ||
let ae = doc.activeElement; | ||
|
||
while (ae?.shadowRoot) { | ||
ae = ae.shadowRoot.activeElement; | ||
} | ||
|
||
return ae; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export const getEventTarget = (event: Event): HTMLElement | null => { | ||
let target = event.target as HTMLElement; | ||
if (target && target.shadowRoot) { | ||
target = event.composedPath()[0] as HTMLElement; | ||
} | ||
|
||
return target; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
export * from './IVirtualElement'; | ||
export * from './elementContains'; | ||
export * from './elementContainsAttribute'; | ||
export * from './findElementRecursive'; | ||
export * from './getChildren'; | ||
export * from './getParent'; | ||
export * from './getVirtualParent'; | ||
export * from './isVirtualElement'; | ||
export * from './portalContainsElement'; | ||
export * from './setPortalAttribute'; | ||
export * from './setVirtualParent'; | ||
export type { IVirtualElement } from './IVirtualElement'; | ||
export { elementContains } from './elementContains'; | ||
export { elementContainsAttribute } from './elementContainsAttribute'; | ||
export { findElementRecursive } from './findElementRecursive'; | ||
export { getActiveElement } from './getActiveElement'; | ||
export { getChildren } from './getChildren'; | ||
export { getEventTarget } from './getEventTarget'; | ||
export { getParent } from './getParent'; | ||
export { getVirtualParent } from './getVirtualParent'; | ||
export { isVirtualElement } from './isVirtualElement'; | ||
export { portalContainsElement } from './portalContainsElement'; | ||
export { DATA_PORTAL_ATTRIBUTE, setPortalAttribute } from './setPortalAttribute'; | ||
export { setVirtualParent } from './setVirtualParent'; | ||
|
||
import './version'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.