CodeSandbox editor has stopped auto completing the corresponding JSX closing tags?

Viewed 3638

CodeSandbox editor used to auto generate the corresponding close tag for the current tag.

For example:

<div> // THEN IT WOULD AUTO GENERATE THE </div> TAG

enter image description here

But don't know exactly when, it stopped doing that, and I have to write it manually. Is there a way to enable this autocomplete again?

3 Answers

In the codesandbox.io go to:

File -> Preferences -> Settings

In the Search Settings box type Javascript Autoclosing Tags.

Enable that feature by checking the Checkbox.

In my case the auto completion works if a change the extension of the file to .jsx and if I start typing the tag without the <.

Just posting an updated answer since the UI has changed for codesandbox. I believe this answer is now slightly better:

  • Press cmd+, (ctrl+, on a windows) with the editor focused (this opens the vscode settings)
  • You should see a settings page like so: image of vscode settings
  • In the Search Settings box type Javascript Autoclosing Tags
  • Toggle the checkbox on
Related