Choosing an editor text style changes the URL hash


Topic: Choosing an editor text style changes the URL hash

codepilot77 asked 4 weeks ago

Selecting a heading in the editor modifies our page URL. The formatting control appears to navigate like a link.

How can formatting run without changing navigation state?


Mateusz Lazaru staff answered 4 weeks ago

Inspect the selected toolbar item in the browser. If it renders an anchor with a hash href, its default navigation can explain the URL change even when the formatting action succeeds. A formatting action should keep the editor selection and avoid navigation.

Please provide the rendered item markup and a minimal editor example with your router. If you maintain a custom toolbar, prevent the link's default action in that item's own handler while preserving its formatting command, or use a non-submit button. Avoid blocking clicks across the entire editor, because that can break real content links.

https://mdbootstrap.com/docs/react/plugins/wysiwyg-editor/


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: MDB React
  • MDB Version: MDB5 9.0.0
  • Device: Desktop
  • Browser: Edge
  • OS: macOS
  • Provided sample code: No
  • Provided link: No