mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 14:27:04 +00:00
Fix definition of ReactModal.setAppElement
This comit changes: - definition of static setAppElement method to support string type - as ReactModal allows to use selector instead of element reference - sample tests to include static method coverage Thanks!
This commit is contained in:
Vendored
+7
-3
@@ -4,7 +4,8 @@
|
||||
// Drew Noakes <https://github.com/drewnoakes>,
|
||||
// Thomas B Homburg <https://github.com/homburg>,
|
||||
// Tatu Tamminen <https://github.com/ttamminen>,
|
||||
// Uwe Wiemer <https://github.com/hallowatcher>
|
||||
// Uwe Wiemer <https://github.com/hallowatcher>,
|
||||
// Peter Blazejewicz <https://github.com/peterblazejewicz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -97,6 +98,9 @@ declare namespace ReactModal {
|
||||
declare class ReactModal extends React.Component<ReactModal.Props> {
|
||||
/* Override base styles for all instances of this component. */
|
||||
static defaultStyles: ReactModal.Styles;
|
||||
/* Call this to properly hide your application from assistive screenreaders and other assistive technologies while the modal is open. */
|
||||
static setAppElement(appElement: HTMLElement): void;
|
||||
/**
|
||||
* Call this to properly hide your application from assistive screenreaders
|
||||
* and other assistive technologies while the modal is open.
|
||||
*/
|
||||
static setAppElement(appElement: string | HTMLElement): void;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
import * as React from "react";
|
||||
import ReactModal = require('react-modal');
|
||||
|
||||
// tests for static method
|
||||
// string
|
||||
ReactModal.setAppElement("#main");
|
||||
// HTMLElement
|
||||
ReactModal.setAppElement(document.getElementById("#main"));
|
||||
|
||||
class ExampleOfUsingReactModal extends React.Component {
|
||||
render() {
|
||||
const onAfterOpenFn = () => { };
|
||||
|
||||
Reference in New Issue
Block a user