-
Notifications
You must be signed in to change notification settings - Fork 810
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fixed] strict matching for tabbable nodes
- Loading branch information
Showing
6 changed files
with
213 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
.ReactModal__Overlay { | ||
-webkit-perspective: 600; | ||
perspective: 600; | ||
opacity: 0; | ||
overflow-x: hidden; | ||
overflow-y: auto; | ||
background-color: rgba(0, 0, 0, 0.5); | ||
} | ||
|
||
.ReactModal__Overlay--after-open { | ||
opacity: 1; | ||
transition: opacity 150ms ease-out; | ||
} | ||
|
||
.ReactModal__Content { | ||
-webkit-transform: scale(0.5) rotateX(-30deg); | ||
transform: scale(0.5) rotateX(-30deg); | ||
} | ||
|
||
.ReactModal__Content--after-open { | ||
-webkit-transform: scale(1) rotateX(0deg); | ||
transform: scale(1) rotateX(0deg); | ||
transition: all 150ms ease-in; | ||
} | ||
|
||
.ReactModal__Overlay--before-close { | ||
opacity: 0; | ||
} | ||
|
||
.ReactModal__Content--before-close { | ||
-webkit-transform: scale(0.5) rotateX(30deg); | ||
transform: scale(0.5) rotateX(30deg); | ||
transition: all 150ms ease-in; | ||
} | ||
|
||
.ReactModal__Content.modal-dialog { | ||
border: none; | ||
background-color: transparent; | ||
} |
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,88 @@ | ||
import React, { Component } from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import Modal from 'react-modal'; | ||
|
||
import '@webcomponents/custom-elements/src/native-shim'; | ||
|
||
var appElement = document.getElementById('example'); | ||
|
||
Modal.setAppElement(appElement); | ||
|
||
class App extends Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = { modalIsOpen: false }; | ||
} | ||
|
||
openModal = () => { | ||
this.setState({modalIsOpen: true}); | ||
} | ||
|
||
closeModal = () => { | ||
this.setState({modalIsOpen: false}); | ||
} | ||
|
||
handleModalCloseRequest = () => { | ||
// opportunity to validate something and keep the modal open even if it | ||
// requested to be closed | ||
this.setState({modalIsOpen: false}); | ||
} | ||
|
||
handleSaveClicked = (e) => { | ||
alert('Save button was clicked'); | ||
} | ||
|
||
render() { | ||
return ( | ||
<div> | ||
<button type="button" className="btn btn-primary" onClick={this.openModal}>Open Modal</button> | ||
<Modal | ||
className="Modal__Bootstrap modal-dialog" | ||
closeTimeoutMS={150} | ||
isOpen={this.state.modalIsOpen} | ||
onRequestClose={this.handleModalCloseRequest} | ||
> | ||
<div className="modal-content"> | ||
<div className="modal-header"> | ||
<h4 className="modal-title">Modal title</h4> | ||
<div className="close"> | ||
<awesome-button></awesome-button> | ||
<button type="button" className="close" onClick={this.handleModalCloseRequest}> | ||
<span aria-hidden="true">×</span> | ||
<span className="sr-only">Close</span> | ||
</button> | ||
</div> | ||
</div> | ||
<div className="modal-body"> | ||
<h4>Really long content...</h4> | ||
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p> | ||
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p> | ||
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p> | ||
</div> | ||
<div className="modal-footer"> | ||
<button type="button" className="btn btn-secondary" onClick={this.handleModalCloseRequest}>Close</button> | ||
<button type="button" className="btn btn-primary" onClick={this.handleSaveClicked}>Save changes</button> | ||
</div> | ||
</div> | ||
</Modal> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
ReactDOM.render(<App/>, appElement); | ||
|
||
class AwesomeButton extends HTMLElement { | ||
constructor() { | ||
super(); | ||
} | ||
|
||
// this shows with no shadow root | ||
connectedCallback() { | ||
this.innerHTML = ` | ||
<button>I'm Awesome!</button> | ||
`; | ||
} | ||
} | ||
|
||
customElements.define("awesome-button", AwesomeButton); |
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,19 @@ | ||
<!doctype html public "embarassment"> | ||
<html> | ||
<head> | ||
<title>Bootstrap-Style Example</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> | ||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"> | ||
<link rel="stylesheet" href="/base.css" type="text/css" /> | ||
<link rel="stylesheet" href="app.css"/> | ||
</head> | ||
<body> | ||
<header class="branding padbox"> | ||
<h1>react-modal</h1> | ||
<h2>an accessible React modal dialog component</h2> | ||
</header> | ||
<div id="example" class="padbox"></div> | ||
<a target="_top" href="https://github.com/reactjs/react-modal"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://github-camo.global.ssl.fastly.net/a6677b08c955af8400f44c6298f40e7d19cc5b2d/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f677261795f3664366436642e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png"></a> | ||
<script type="application/javascript" src="/__build__/wc.js"></script> | ||
</body> | ||
</html> |
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