Skip to content

Instantly share code, notes, and snippets.

@hakilebara
Last active March 14, 2019 10:14
Show Gist options
  • Save hakilebara/b8858ed05359fbf25c9673d1ca95bc93 to your computer and use it in GitHub Desktop.
Save hakilebara/b8858ed05359fbf25c9673d1ca95bc93 to your computer and use it in GitHub Desktop.
Ember Modal Dialog & Focus Trap
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
body {
margin: 12px 16px;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 12pt;
}
<br>
<br>
<ModalDialog>
<FocusTrapper @cycle=true>
Oh hai there!
<form action="">
<label>You must fill out this input field: <input type="text"></label>
<label>And this input field: <input type="text"></label>
</form>
</FocusTrapper>
</ModalDialog>
<br>
<br>
{
"version": "0.15.1",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js",
"ember": "3.4.3",
"ember-template-compiler": "3.4.3",
"ember-testing": "3.4.3"
},
"addons": {
"ember-data": "3.4.2",
"ember-modal-dialog": "2.4.3",
"ember-focus-trapper": "0.3.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment