Skip to content

Commit

Permalink
Feature/android keyboard support (ianstormtaylor#4200)
Browse files Browse the repository at this point in the history
* Added Android Keyboard Support

* Added changeset for android keyboard support

* Removed dead code in android editable that supported non-android environments

* Removed unnecessary attributes observation for android-editable

* Removed dead code

* Added no-error boundary

* Fixed issues with linters
  • Loading branch information
wleroux authored May 12, 2021
1 parent 351d0a1 commit e03ce7c
Show file tree
Hide file tree
Showing 15 changed files with 1,197 additions and 43 deletions.
5 changes: 5 additions & 0 deletions .changeset/small-laws-remember.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'slate-react': minor
---

Added android keyboard support for slate editor
11 changes: 1 addition & 10 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,6 @@
}
],
"use-isnan": "error",
"valid-jsdoc": [
"error",
{
"prefer": {
"return": "returns"
},
"requireReturn": false
}
],
"valid-typeof": "error",
"yield-star-spacing": [
"error",
Expand All @@ -179,4 +170,4 @@
}
}
]
}
}
20 changes: 20 additions & 0 deletions packages/slate-react/src/components/android/ErrorBoundary.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React, { PropsWithChildren } from 'react'

export class ErrorBoundary extends React.Component<
PropsWithChildren<{}>,
never
> {
static getDerivedStateFromError(error: Error) {
// Update state so the next render will show the fallback UI.
return { hasError: true }
}

componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {
// eslint-disable-next-line no-console
console.error(error)
}

render() {
return this.props.children
}
}
Loading

0 comments on commit e03ce7c

Please sign in to comment.