Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP focus setting for modal open and close #785

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/views/components/widget/_fba.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ function FBAform(d, N) {
},
handleButtonClick: function(e) {
e.preventDefault();
// store a reference to the button ID so we can set focus back here when modal closes
this.loadDialog();
},
handleDialogClose: function(e) {
Expand Down Expand Up @@ -374,6 +375,7 @@ function FBAform(d, N) {
loadDialog: function()
{
d.querySelector('.fba-modal').removeAttribute("hidden");
d.getElementById("touchpoints-form-<%= form.short_uuid %>").focus();
this.dialogOpen = true;
},
closeDialog: function()
Expand Down
2 changes: 1 addition & 1 deletion app/views/components/widget/_no_modal.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="touchpoints-form-wrapper" data-touchpoints-form-id="<%= form.short_uuid %>">
<div class="touchpoints-form-wrapper" id="touchpoints-form-<%= form.short_uuid %>" data-touchpoints-form-id="<%= form.short_uuid %>">
<div class="wrapper">
<% if form.title? %>
<h3 id="fba-modal-title">
Expand Down