Issue #3511Opened June 2, 2021by moises-flowize0 reactions

BUG: Command core:component-enter not working in all the cases

Question

WARNING

READ and FOLLOW next 3 steps, then REMOVE them before posting the issue

  1. Follow CONTRIBUTING Guidelines https://github.com/artf/grapesjs/blob/master/CONTRIBUTING.md
  2. Do a quick SEARCH first, to see if someone else didn't open the same issue
  3. All relative statements/questions have to be filled/answered, otherwise, the issue might be CLOSED
  4. JSFiddle Starter template https://jsfiddle.net/szLp8h4n
  5. CodeSandbox Starter template https://codesandbox.io/s/1r0w2pk1vl

Version: 0.16.44

You can get the version by typing grapesjs.version into the console

Are you able to reproduce the bug from the demo?

  • Yes
  • [X ] No

What is the expected behavior? When using the command "core:component-enter" it should select the first child of a container

Describe the bug detailed If the element selected is a P or H1, the ones that are inline elements it throws an error In the console. Also, if the element select is a container but the first child is an HTML comment, throws the same error.

Are you able to attach screenshots, screencasts or a live demo?

  • Yes (attach)
  • [ x] No

I fixed creating my own command out of the code of yours at https://github.com/artf/grapesjs/blob/dev/src/commands/view/ComponentEnter.js:

I attach the JS file with the code of my command component-enter.txt

Answers (1)

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.