Почему клавиша Enter игнорирует вкладку Index? - PullRequest
0 голосов
/ 03 октября 2018

Вот мой файл cshtml:

@using System.Web.Mvc;
@using Kendo.Mvc.UI;
@using System;
@using System.Data;
@using System.Collections.Generic;
@using System.Text;

@model My.Name.Space.Models.SomeObject

@{
    ViewBag.Title = "My Title";
    Layout = Request.IsAjaxRequest() ? null : "~/Views/Shared/_Layout.cshtml";
}

<div id="dv3" class="scrollarea">
    @using (Ajax.BeginForm("dv3", "", new AjaxOptions() { HttpMethod = "Post" }, new { id = "frmP3" }))
    {
        @Html.AntiForgeryToken()

        <div>
            @(Html.TextBoxFor(m => m.Field1, new { id = "txt1", @tabIndex = "1" }))
            @(Html.TextBoxFor(m => m.Field11, new { id = "txt11", @tabIndex = "11" }))
            @(Html.TextBoxFor(m => m.Field21, new { id = "txt21", @tabIndex = "21" }))
            <br /><br />
            @(Html.TextBoxFor(m => m.Field2, new { id = "txt2", @tabIndex = "2" }))
            @(Html.TextBoxFor(m => m.Field12, new { id = "txt12", @tabIndex = "12" }))
            @(Html.TextBoxFor(m => m.Field22, new { id = "txt22", @tabIndex = "22" }))
            <br /><br />
            @(Html.TextBoxFor(m => m.Field3, new { id = "txt3", @tabIndex = "3" }))
            @(Html.TextBoxFor(m => m.Field13, new { id = "txt13", @tabIndex = "13" }))
            @(Html.TextBoxFor(m => m.Field23, new { id = "txt23", @tabIndex = "23" }))
            <br /><br />
            @(Html.TextBoxFor(m => m.Field4, new { id = "txt4", @tabIndex = "4" }))
            @(Html.TextBoxFor(m => m.Field14, new { id = "txt14", @tabIndex = "14" }))
            @(Html.TextBoxFor(m => m.Field24, new { id = "txt24", @tabIndex = "24" }))
        </div>
    }
</div>

Мой контроллер одинаково прост:

public ActionResult View3()
{
    return View(base.GetViewPath("3"), new SomeObject());
}

Я запускаю приложение и перехожу на эту страницу, затем устанавливаю фокус на txt1.Когда я нажимаю Tab фокус меняется с txt1 на txt2.Отлично.

Если я нажму Enter, фокус изменится с txt1 на txt11.Неправильно.Предполагается, что он перейдет к элементу управления с ближайшим индексом ближайшей вкладки.

Почему Enter не следует тому же порядку, что и Tab?

...