Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Foreach loop #5766

Open
ArunPatal opened this issue Mar 8, 2025 · 0 comments
Open

Foreach loop #5766

ArunPatal opened this issue Mar 8, 2025 · 0 comments

Comments

@ArunPatal
Copy link

Describe the bug

Hello, i am using ace editor in Firefox 34 (win xp).

In recent changes browser throw an error in line 17339.
TypeError: activeIndentGuides.forEach is not a function


Changing

 activeIndentGuides.forEach(function (el) {
            el.classList.remove("ace_indent-guide-active");
        });

To

for(var i = 0; i < activeIndentGuides.length; i++){
        	activeIndentGuides[i].classList.remove("ace_indent-guide-active");
        };

will fix this.

Please make this change to original source.

Thanks

Expected Behavior

avoid foreach loop to make it work in old browser as well.

Current Behavior

foreach throws an error

Reproduction Steps

 activeIndentGuides.forEach(function (el) {
            el.classList.remove("ace_indent-guide-active");
        });

Possible Solution

change line 17339

for(var i = 0; i < activeIndentGuides.length; i++){
        	activeIndentGuides[i].classList.remove("ace_indent-guide-active");
        };

Additional Information/Context

No response

Ace Version / Browser / OS / Keyboard layout

1.39.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants