Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-7417

Search keywords field does not initially get focus

    Details

    • Type: Bug
    • Status: Unverified Fix
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.1
    • Fix Version/s: 3.0.8-RC1
    • Component/s: Search
    • Labels:
      None

      Description

      One of my site members noticed that the keyboard focus is not set to the keywords field when search.php is selected, requiring a second click. I confirmed this using IE and Firefox on Vista.

      Adding a little bit of JavaScript to the search_body.html worked for Firefox:

      <script type="text/javascript" language="javascript">document.getElementById("keywords").focus();</script>

      Unfortunately it did not work for IE. The login also has the same problem, i.e., a second click is required.

        Activity

        Hide
        Oleg Oleg [X] (Inactive) added a comment -

        The reason why focus does not work in ie on search page is due to ie bug where getElementById returns elements whose name matches the id given. In particular, ie finds and attempts to focus this element:

        <meta name="keywords" content="" />

        Show
        Oleg Oleg [X] (Inactive) added a comment - The reason why focus does not work in ie on search page is due to ie bug where getElementById returns elements whose name matches the id given. In particular, ie finds and attempts to focus this element: <meta name="keywords" content="" />
        Hide
        Oleg Oleg [X] (Inactive) added a comment -

        Patch for prosilver for standards-compliant browsers.

        It handles login and search pages.

        Login page should work on ie too.

        Show
        Oleg Oleg [X] (Inactive) added a comment - Patch for prosilver for standards-compliant browsers. It handles login and search pages. Login page should work on ie too.
        Hide
        Oleg Oleg [X] (Inactive) added a comment -

        Patch for subsilver: http://github.com/p/phpbb3/compare/feature/7417-subsilver

        I can't get it to actually work. This code if executed after page is loaded focuses the text fields successfully in fx but it does nothing when it runs during page load.

        Due to subsilver remaining blissfully unaware of element id's and onload functions, quite a bit more contraption is required to make it work.

        Show
        Oleg Oleg [X] (Inactive) added a comment - Patch for subsilver: http://github.com/p/phpbb3/compare/feature/7417-subsilver I can't get it to actually work. This code if executed after page is loaded focuses the text fields successfully in fx but it does nothing when it runs during page load. Due to subsilver remaining blissfully unaware of element id's and onload functions, quite a bit more contraption is required to make it work.
        Hide
        DavidIQ David Colón added a comment - - edited

        Why don't you try this instead:

        if (elements[i].id == 'keywords')
        

        Also for prosilver you need to push that function to the onload_functions array. For subsilver2 you'd have to assign your function to window.onload.

        Show
        DavidIQ David Colón added a comment - - edited Why don't you try this instead: if (elements[i].id == 'keywords') Also for prosilver you need to push that function to the onload_functions array. For subsilver2 you'd have to assign your function to window.onload.
        Hide
        naderman Nils Adermann added a comment -

        What's the status here? Should I be waiting for an update to the subsilver fix?

        Show
        naderman Nils Adermann added a comment - What's the status here? Should I be waiting for an update to the subsilver fix?
        Hide
        Oleg Oleg [X] (Inactive) added a comment -

        I am happy with subsilver fix in http://github.com/p/phpbb3/compare/feature/7417-subsilver. True, it is verbose but it does seem to function and considering that subsilver is being eliminated anyway I don't see much point in spending more time on it.

        Show
        Oleg Oleg [X] (Inactive) added a comment - I am happy with subsilver fix in http://github.com/p/phpbb3/compare/feature/7417-subsilver . True, it is verbose but it does seem to function and considering that subsilver is being eliminated anyway I don't see much point in spending more time on it.
        Hide
        bantu Andreas Fischer added a comment -

        I'll merge both branches.

        Show
        bantu Andreas Fischer added a comment - I'll merge both branches.

          People

          • Assignee:
            bantu Andreas Fischer
            Reporter:
            HB HB
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development