-
-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make blinking input carets transparent to avoid flakiness (#241)
- Loading branch information
Showing
8 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+301 Bytes
examples/react/.loki/reference/chrome_iphone7_FocusedInput_default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+191 Bytes
examples/react/.loki/reference/chrome_laptop_FocusedInput_default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,5 @@ | ||
import React from 'react'; | ||
|
||
const FocusedInput = () => <input type="text" autoFocus />; | ||
|
||
export default FocusedInput; |
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,16 @@ | ||
const disableInputCaret = window => { | ||
const DISABLE_INPUT_CARET_STYLE = ` | ||
* { | ||
caret-color: transparent !important; | ||
} | ||
`; | ||
|
||
// Make blinking input carets transparent to avoid flakiness. | ||
window.document.addEventListener('DOMContentLoaded', () => { | ||
const styleElement = window.document.createElement('style'); | ||
window.document.documentElement.appendChild(styleElement); | ||
styleElement.sheet.insertRule(DISABLE_INPUT_CARET_STYLE); | ||
}); | ||
}; | ||
|
||
module.exports = disableInputCaret; |
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