TAP5-2420: Confirm mixin has issues related to keyboard navigation
Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/bed56af4 Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/bed56af4 Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/bed56af4 Branch: refs/heads/beanmodel-split Commit: bed56af4327a3c11c44ea5ff5f651965d843c59e Parents: 1956c56 Author: Howard M. Lewis Ship <hls...@apache.org> Authored: Mon Nov 24 11:03:03 2014 -0800 Committer: Howard M. Lewis Ship <hls...@apache.org> Committed: Mon Nov 24 11:03:03 2014 -0800 ---------------------------------------------------------------------- .../modules/t5/core/confirm-click.coffee | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/bed56af4/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/confirm-click.coffee ---------------------------------------------------------------------- diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/confirm-click.coffee b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/confirm-click.coffee index ff13e44..013ecac 100644 --- a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/confirm-click.coffee +++ b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/confirm-click.coffee @@ -1,17 +1,3 @@ -# Copyright 2013 The Apache Software Foundation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http:#www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - # ## t5/core/confirm-click # # Support for the Tapestry Confirm mixin, and for running confirmation dialogs programatically. @@ -35,7 +21,7 @@ define ["jquery", "./events", "./dom", "bootstrap/modal"], confirmed = false content = """ - <div class="modal fade" role="dialog"> + <div class="modal fade" role="dialog" tabindex='-1'> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> @@ -66,6 +52,10 @@ define ["jquery", "./events", "./dom", "bootstrap/modal"], $dialog.appendTo $ "body" + # Focus on the first button (the "OK") button. + $dialog.on "shown.bs.modal", -> + $dialog.find(".modal-footer .btn").first().focus() + # Support for the Confirm mixin $("body").on "click", "[data-confirm-message]:not(.disabled)", ->