Skip to content

Commit

Permalink
added focus-lock to modals (#1567)
Browse files Browse the repository at this point in the history
* added focus-lock to modals

* version bump

* version bump part 2
  • Loading branch information
nicholas-goodwin authored Jan 4, 2023
1 parent 96e85da commit 6a2f76d
Show file tree
Hide file tree
Showing 14 changed files with 105 additions and 5,515 deletions.
5 changes: 4 additions & 1 deletion apps/andi/assets/css/search-modal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,10 @@
}

.remove-selected-result {
font-size: 20px;
color: white;
font-size: 15px;
padding-left: 0px;
padding-right: 0px;
&:hover {
cursor: pointer;
}
Expand Down
20 changes: 19 additions & 1 deletion apps/andi/assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import 'tippy.js/dist/tippy.css';
import normalize_css from 'normalize.css'
import scss from "../css/app.scss"
import tippy from 'tippy.js';
import Alpine from 'alpinejs';
import focus from '@alpinejs/focus';

// webpack automatically bundles all modules in your
// entry points. Those entry points can be configured
Expand All @@ -21,6 +23,10 @@ import "phoenix_html"
import { Socket } from 'phoenix'
import { LiveSocket } from 'phoenix_live_view'

window.Alpine = Alpine
Alpine.plugin(focus)
Alpine.start()

let Hooks = {}

Hooks.showSnackbar = {
Expand Down Expand Up @@ -117,5 +123,17 @@ const fileToText = (file) => new Promise((resolve, reject) => {


let csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content");
let liveSocket = new LiveSocket('/live', Socket, {hooks: Hooks, params: {_csrf_token: csrfToken}})
let liveSocket = new LiveSocket('/live', Socket,
{
hooks: Hooks,
params: {_csrf_token: csrfToken},
dom: {
onBeforeElUpdated(from, to) {
if (from._x_dataStack) {
window.Alpine.clone(from, to)
}
}
}
}
)
liveSocket.connect()
Loading

0 comments on commit 6a2f76d

Please sign in to comment.