Skip to content

Commit

Permalink
Workaround for fullscreen in Safari
Browse files Browse the repository at this point in the history
  • Loading branch information
paveli committed Jul 2, 2019
1 parent e86eeab commit c0567dc
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/components/Onboarding.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ class Onboarding extends Component {
fontWeight: "normal"
}}
>
Flow — distraction-free writer, that helps to stay focused while
writing texts.
Flow — distraction-free writer, which helps to stay focused
while writing texts.
</h1>
<p>
Start writing. Move forward. Don't edit (and you can't{" "}
Expand All @@ -141,11 +141,13 @@ class Onboarding extends Component {
onClick={() => {
this.setState({ showOnboarding: "false" });
let TextEditor = document.getElementById("TextEditor");
TextEditor.requestFullscreen().then(resolve => {
document
.getElementById("currentInput")
.focus({ preventScroll: false });
});
if (TextEditor.requestFullscreen) {
TextEditor.requestFullscreen().then(resolve => {
document
.getElementById("currentInput")
.focus({ preventScroll: false });
});
}
document
.getElementById("currentInput")
.focus({ preventScroll: false });
Expand Down

0 comments on commit c0567dc

Please sign in to comment.