Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-14936

Confluence's Javascript Autofocus on First Text Field Onpage Load

      http://developer.atlassian.com/jira/browse/TASK-127

      There is a javascript in Confluence that calls placeFocus() on page load. That script will inevitable search the whole page and focus the first text field that is visible and not disabled.

      This will cause the page to auto scroll down to where the tasklist's text field is on page load. There is no good way currently in the JavaScript to bypass the autofocus.

            [CONFSERVER-14936] Confluence's Javascript Autofocus on First Text Field Onpage Load

            I'm seeing an issue in v5.16 enterprise where updating a task causing my chrome browser to auto scroll to the top (seems like it may be related to the autofocus issue). Are there any other open bugs that someone could point me to?

            Derek Thrasher added a comment - I'm seeing an issue in v5.16 enterprise where updating a task causing my chrome browser to auto scroll to the top (seems like it may be related to the autofocus issue). Are there any other open bugs that someone could point me to?

            Stefan Hett added a comment - - edited

            @Denise to me it sounds a bit inaccurate to mark this one as obsolete for 5.5. According to Anatoli the issue which was refering to the tasklist macro was already resolved in 3.2.1. I just confirmed that on 5.4.4 the issue is not present there anymore.

            The other issues are pointing towards the more generic issue of the root cause of the problem, which is not limited to the described use-case related to the task list macro.
            As far as I understand the handling of issues here, this is however independent from how this particular issue should be treated.

            Therefore, shouldn't this one be set to fixed in 3.2.1 rather than being obsolete in 5.5?

            Stefan Hett added a comment - - edited @Denise to me it sounds a bit inaccurate to mark this one as obsolete for 5.5. According to Anatoli the issue which was refering to the tasklist macro was already resolved in 3.2.1. I just confirmed that on 5.4.4 the issue is not present there anymore. The other issues are pointing towards the more generic issue of the root cause of the problem, which is not limited to the described use-case related to the task list macro. As far as I understand the handling of issues here, this is however independent from how this particular issue should be treated. Therefore, shouldn't this one be set to fixed in 3.2.1 rather than being obsolete in 5.5?

            The dynamic tasklist macro was removed and replaced with Tasks in Confluence 5.5. Closing as obsolete.

            Denise Unterwurzacher [Atlassian] (Inactive) added a comment - The dynamic tasklist macro was removed and replaced with Tasks in Confluence 5.5. Closing as obsolete.

            Hi folks, I see the comments stating that the issue was fixed in Confluence 3.2.1, but I'm having a related problem in Confluence 5.3.4 if I try to use a custom theme with the placeFocus() script. Is the problem back in Confluence 5.3.4?

            Atlassian quick-search form HTML (note the "dont-default-focus" class)
            <form id="quick-search" class="aui-quicksearch dont-default-focus header-quicksearch" action="/dosearchsite.action" method="get">

            Atlassian default body tag:
            <body onload="placeFocus()"
            id="com-atlassian-confluence" class="theme-default dashboard aui-layout aui-theme-default">

            custom body tag without placeFocus, which also works normally:
            <body id="home">

            custom body tag which triggers the problem with focus:
            <body onload="placeFocus()"
            id="com-atlassian-confluence" class="itdptheme ">

            Joe Westcott (ITDP) added a comment - Hi folks, I see the comments stating that the issue was fixed in Confluence 3.2.1, but I'm having a related problem in Confluence 5.3.4 if I try to use a custom theme with the placeFocus() script. Is the problem back in Confluence 5.3.4? Atlassian quick-search form HTML (note the "dont-default-focus" class) <form id="quick-search" class="aui-quicksearch dont-default-focus header-quicksearch" action="/dosearchsite.action" method="get"> Atlassian default body tag: <body onload="placeFocus()" id="com-atlassian-confluence" class="theme-default dashboard aui-layout aui-theme-default"> custom body tag without placeFocus, which also works normally: <body id="home"> custom body tag which triggers the problem with focus: <body onload="placeFocus()" id="com-atlassian-confluence" class="itdptheme ">

            We're experiencing the same issue when using Form Mail NG plugin (editable form created at the bottom of Confluence page). We're currently on v.3.1.1.

            Monika Antos added a comment - We're experiencing the same issue when using Form Mail NG plugin (editable form created at the bottom of Confluence page). We're currently on v.3.1.1.

            DavidA added a comment -

            This needs to be fixed. I think it will cause problems to any plugin that generates a focusable textfield. See CONF-11010.

            DavidA added a comment - This needs to be fixed. I think it will cause problems to any plugin that generates a focusable textfield. See CONF-11010 .

            Anatoli added a comment -

            This issue is still opened because we need to clean up some javascript code in confluence. However the new version that works around the confluence problem has been released: 3.2.1. Please use the new version to avoid the bug.

            Anatoli added a comment - This issue is still opened because we need to clean up some javascript code in confluence. However the new version that works around the confluence problem has been released: 3.2.1. Please use the new version to avoid the bug.

            Hi Jonathan,

            Here is the link to the javascript file, placeFocus() method at line 19:-
            https://svn.atlassian.com/atlaseye/browse/confluence/trunk/conf-webapp/src/main/webapp/includes/js/effects.js?r=66605#l19

            At line 71, is where it'll focus the text field if it doesn't have an autoFocusElementId.

            Cheers,
            Philip

            Philip Cher added a comment - Hi Jonathan, Here is the link to the javascript file, placeFocus() method at line 19:- https://svn.atlassian.com/atlaseye/browse/confluence/trunk/conf-webapp/src/main/webapp/includes/js/effects.js?r=66605#l19 At line 71, is where it'll focus the text field if it doesn't have an autoFocusElementId. Cheers, Philip

            Hi Philip,

            Can you pointpoint exactly where the autofocus is called? Which javascript file? Or a line to search on?

            Cheers,
            Jonathan

            Jonathan Nolen (Inactive) added a comment - Hi Philip, Can you pointpoint exactly where the autofocus is called? Which javascript file? Or a line to search on? Cheers, Jonathan

              Unassigned Unassigned
              pcher Philip Cher
              Affected customers:
              10 This affects my team
              Watchers:
              14 Start watching this issue

                Created:
                Updated:
                Resolved: