Can’t indent using tab key in code editor

Request: I want to indent with the Tab key.

Problem: Pressing the Tab key takes me from the code editing area to the Check Code button.

My Environment:
Chrome Version 120.0.6099.130 (Official Build) (64-bit),
Windows 11 Home 10.0.22621 Build 22621 (64-bit)

@nishiki3
In Python, indentation is typically done using spaces rather than the tab key. Most style guides, including PEP 8 (the Python Enhancement Proposal that describes the style guide for Python code), recommend using 4 spaces for each level of indentation.

In modern code editors and IDEs, when you press the “Tab” key, it often inserts spaces instead of an actual tab character by default.

So try using the space key and give 4 spaces for each level of indentation.

2 Likes

Hello there,

I am unable to reproduce this in the freeCodeCamp editor. What challenge/certification are you experiencing this?

Do you have any specific accessibility features set for your browser?

1 Like

Thank you. From now on, I will use the Space key for indentation instead of the Tab key.

Thank you. I am taking “JavaScript Algorithms and Data Structures (Beta)”. I’m not sure if you have a specific accessibility feature set in your browser, but I don’t remember changing it.

FYI, you can control whether the Tab key inserts a tab or moves you to the Check Your Code button using the Ctrl+m toggle. While your keyboard focus is in the editor, press Ctrl+m to toggle between these two options. Inserting tabs is the default, so perhaps you accidentally hit Ctrl+m and turned that off by mistake?

3 Likes

Thank you, I had never heard of it being possible to switch it on with ctrl + M. I will give it a try.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.