Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e284462
commit ee1be1c
Showing
11 changed files
with
720 additions
and
327 deletions.
There are no files selected for viewing
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
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
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
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,14 +1,12 @@ | ||
import {fireEvent} from '@testing-library/dom' | ||
import {getActiveElement, isFocusable, eventWrapper} from './utils' | ||
|
||
function blur(element, init) { | ||
function blur(element) { | ||
if (!isFocusable(element)) return | ||
|
||
const wasActive = getActiveElement(element.ownerDocument) === element | ||
if (!wasActive) return | ||
|
||
eventWrapper(() => element.blur()) | ||
fireEvent.focusOut(element, init) | ||
} | ||
|
||
export {blur} |
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,14 +1,12 @@ | ||
import {fireEvent} from '@testing-library/dom' | ||
import {getActiveElement, isFocusable, eventWrapper} from './utils' | ||
|
||
function focus(element, init) { | ||
function focus(element) { | ||
if (!isFocusable(element)) return | ||
|
||
const isAlreadyActive = getActiveElement(element.ownerDocument) === element | ||
if (isAlreadyActive) return | ||
|
||
eventWrapper(() => element.focus()) | ||
fireEvent.focusIn(element, init) | ||
} | ||
|
||
export {focus} |
Oops, something went wrong.