Skip to content

Bug: Debugbar Click(toggle) Scrolls Document to Top #8594

Closed
@acpadhi

Description

@acpadhi

PHP Version

8.2, 8.3

CodeIgniter4 Version

4.4.6

CodeIgniter4 Installation Method

Manual (zip or tar.gz)

Which operating systems have you tested for this bug?

Linux

Which server did you use?

fpm-fcgi

Database

Mariadb

What happened?

CI 4.4.6 : When clicking on Debug toolbar, the document is scrolled automatically to the TOP, as if someone had clicke an achor link to body tag.

Does not happen in 4.4.1, So I inspected the a href tags used (in both the CI versions) for the toggle buton of the debugtoolbar.

4.4.1 : <a id="debug-bar-link" href="**javascript:void(0)**" title="Open/Close">
4.4.6 : <a id="debug-bar-link" href="**#**" title="Open/Close">

I believe somewhere in the toolbar.js either return false is required, or preventdefault is to be used.

This can mess up with JS based routing as well I believe.

Steps to Reproduce

Switch to development mode :

  1. Create a Page that has content more than the window height so as to show scrollbars on right side.
  2. Scroll down to the bottom of the page.
  3. Click on the debugtoolbar toggle button.

It can be noticed that the page scrolls to the top.

Expected Output

Page position should remain as it is and should not scroll at all.

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugVerified issues on the current code behavior or pull requests that will fix them

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions