Skip to content

fix(editor): NO-JIRA empty div issue with nested block elements#1121

Merged
Maysam Kangarani Farahani (maysamkf) merged 2 commits intostagingfrom
fix-spacing-issue
Mar 18, 2026
Merged

fix(editor): NO-JIRA empty div issue with nested block elements#1121
Maysam Kangarani Farahani (maysamkf) merged 2 commits intostagingfrom
fix-spacing-issue

Conversation

@maysamkf
Copy link
Copy Markdown
Contributor

@maysamkf Maysam Kangarani Farahani (maysamkf) commented Mar 12, 2026

Empty div issue with nested block elements

Obligatory GIF (super important!)

Obligatory GIF

🛠️ Type Of Change

These types will increment the version number on release:

  • Fix
  • Feature
  • Performance Improvement
  • Refactor

📖 NO-JIRA

📖 Description

  • Added logic to not convert divs with block children into paragraphs

💡 Context

Nesting a block element in a div would cause it to render an extra newline (see SS below).
This is likely due to how Tiptap tries to flatten the html when parsing it.

📝 Checklist

For all PRs:

  • I have ensured no private Dialpad links or info are in the code or pull request description (Dialtone is a public repo!).
  • I have reviewed my changes.
  • I have added all relevant documentation.
  • I have considered the performance impact of my change.

📷 Screenshots / GIFs

Observed Issue:

Screenshot 2026-03-11 at 6 17 09 PM

Fix:

Screenshot 2026-03-11 at 6 17 05 PM

@github-actions
Copy link
Copy Markdown
Contributor

✔️ Deploy previews ready!
😎 Dialtone documentation preview: https://dialtone.dialpad.com/deploy-previews/pr-1121/
😎 Dialtone-vue preview: https://dialtone.dialpad.com/vue/deploy-previews/pr-1121/

Copy link
Copy Markdown
Contributor

@braddialpad Brad Paugh (braddialpad) left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like a bit of a hack, is this not something that can be configured in TipTap/prosemirror itself?

If there's truly no other option we can go with it.

@maysamkf
Copy link
Copy Markdown
Contributor Author

This feels like a bit of a hack, is this not something that can be configured in TipTap/prosemirror itself?

If there's truly no other option we can go with it.

tried looking for other ways, but this seems to be the only way AFAIK.

@maysamkf Maysam Kangarani Farahani (maysamkf) merged commit a9bb763 into staging Mar 18, 2026
18 checks passed
@maysamkf Maysam Kangarani Farahani (maysamkf) deleted the fix-spacing-issue branch March 18, 2026 22:41
Brad Paugh (braddialpad) pushed a commit that referenced this pull request Mar 19, 2026
# [3.217.0](dialtone-vue/v3.216.0...dialtone-vue/v3.217.0) (2026-03-19)

### Bug Fixes

* **Editor:** NO-JIRA empty div issue with nested block elements ([#1121](#1121)) ([a9bb763](a9bb763))

### Features

* DLT-3144 support truncation within message input bottom btns ([#1134](#1134)) ([22175f5](22175f5))
Brad Paugh (braddialpad) pushed a commit that referenced this pull request Mar 19, 2026
# [9.174.0](dialtone/v9.173.0...dialtone/v9.174.0) (2026-03-19)

### Bug Fixes

* **Deprecated Component:** NO-JIRA fix deprecated component regex ([#1140](#1140)) ([6d1a76f](6d1a76f))
* **Editor:** NO-JIRA empty div issue with nested block elements ([#1121](#1121)) ([a9bb763](a9bb763))
* **Workflow:** SEC-2156 claude-review ([#1138](#1138)) ([d8483ba](d8483ba))

### Features

* **Dialtone Docs:** DDT-1622 add AI documentation package — content, validation, and templates ([#1051](#1051)) ([633c331](633c331))
* DLT-3144 support truncation within message input bottom btns ([#1134](#1134)) ([22175f5](22175f5))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-visual-test Add this tag when the PR does not need visual testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants