midudev / codi.link

HTML, CSS, JS sandbox.

Home Page:https://codi.link

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Don't reload the preview on css changes

davbrito opened this issue · comments

I often face the situation where I must do certain interactions to put the UI in a state with JavaScript. But when I make any change on the CSS, instead of just replacing the styles it'd reload the preview and therefore I lose any state of the application preview.

Here is an example of the current behavior:

  • Before interaction:
    image

  • After interaction:
    image

  • After CSS edit:
    image

As you can see. After changing the CSS, the preview is reloaded and the state is losen, so the span instead of retaining the "David" inner text it resets to "World", instead of applying the new styles to the current content.

Something to take into account if this is implemented is that there should be a button for reloading the preview if that is what the user wants.

PD: Congrats to @midudev and all the community for making such a great work with this project.

I am currently working on a pull request to resolve this issue. When I publish it I will be open to any suggestion or improvement.

Closed by #186