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

Extra <p> inserted on each save #2091

Closed
ikushlianski opened this issue Jul 27, 2018 · 1 comment
Closed

Extra <p> inserted on each save #2091

ikushlianski opened this issue Jul 27, 2018 · 1 comment

Comments

@ikushlianski
Copy link

ikushlianski commented Jul 27, 2018

Please do not submit support requests or "How to" questions here. For that, go to StackOverflow.

What you were expecting:
Expected no extra

markup to be inserted on each save.

What happened instead:
Each time I save the vacancy with RichTextInput as one of the fields an extra

tag appears between one

and

    that follows it.

    Steps to reproduce:

    1. Type some usual text and then write a list of 2-3 items on the next paragraph.
      Thus you will have something like this:
      <p>We are looking for a skilled and passionate <strong>Embedded Linux Developer</strong>, who is ready to join one of our IoT-focused teams:</p><ul><li>the one is on a mission to transform modern ways of mobility and energy consumption. You will be involved in the development of applications for cloud connected devices and smart electric vehicle chargers on an embedded Linux platform running on an ARM processor;</li><li>another one is at the heart of next-gen automotive solution enabling smarter logistics and advanced telematics for one of the world's leaders in self-driving cars market;</li><li>alternatively, you could pioneer with us in productizing wearable devices which lie at the intersection of IoT, Social data management, Big Data integration and advanced analytics;</li></ul>
    2. Save the post. Enter the edit component again and you will see an extra paragraph inserted between first <p> and the <ul>
    3. Add some text to the 1st item on the list and do not remove the extra paragraph (for reproducing).
    4. Save and open the edit component again. You will see a second empty paragraph being added. And so on and so forth.

    If one does not touch the list (does not add or remove something from it) the number of empty paragraphs does not increase. The same single empty <p> remains after each save. Trying to remove that empty <p> is fruitless: it reappears when you next enter the edit component.

    Environment

    • React-admin version: ^2.1.1
    • Last version that did not exhibit the issue (if applicable):
    • React version: ^16.4.1
    • Browser: Chrome, Opera
@lihop
Copy link

lihop commented Aug 28, 2018

This is related to marmelab/aor-rich-text-input#11.

In b65e697#diff-c8090629b5a5ba95a6f9c5154882be18R40 quill was upgraded from v1.1.9 to v1.3.6, meaning that we can now set the matchVisual option to false in the clipboard configuration.

I can confirm that this resolves the issue, but it changes the clipboard behaviour so we might want to reset the config after the clipboard has been used to set the content on form load.

componentDidMount() {
const {
input: { value },
toolbar,
} = this.props;
this.quill = new Quill(this.divRef, {
modules: { toolbar },
theme: 'snow',
});
this.quill.setContents(this.quill.clipboard.convert(value));

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

3 participants