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

The texteditor widget does not work properly: the toolbar can not format the text as designed. #7460

Open
yejustme opened this issue Nov 5, 2024 · 0 comments

Comments

@yejustme
Copy link

yejustme commented Nov 5, 2024

ALL software version info

(this library, plus any other relevant software, e.g. bokeh, python, notebook, OS, browser, etc should be added within the dropdown below.)

Software Version Info
os: windows 10
python: 3.12.1
panel: 1.5.3
bokeh: 3.4.3
browser: edge 130.0.2849.68

The texteditor widget is not working properly. If I enter any text inside and then click the buttons in the toolbar to change the format, such as bold, underline, or change color, it won't work.

However, if these buttons are clicked first, they will become selected, and then the text format can be set by entering it. But this does not conform to our general process of editing text. If every input of text needs to be pre-set to indicate whether it needs to be bolded or italicized, the thought process will be interrupted.
So, it seems like there may be a bug present.https://github.com/user-attachments/assets/b48bed9d-80be-40a6-8fd9-89f13dce0603

Complete, minimal, self-contained example code that reproduces the issue

import panel as pn
import param

pn.extension('texteditor')
pn.config.sizing_mode = 'stretch_width'

# Full configuration
full_config = pn.widgets.TextEditor(toolbar=[
  ['bold', 'italic', 'underline', 'strike'],        # toggled buttons
  ['blockquote', 'code-block'],
  ['link', 'image'],
  [{ 'header': 1 }, { 'header': 2 }],               # custom button values
  [{ 'list': 'ordered'}, { 'list': 'bullet' }],
  [{ 'script': 'sub'}, { 'script': 'super' }],      # superscript/subscript
  [{ 'indent': '-1'}, { 'indent': '+1' }],          # outdent/indent
  [{ 'direction': 'rtl' }],                         # text direction

  [{ 'size': ['small', False, 'large', 'huge'] }],  # custom dropdown
  [{ 'header': [1, 2, 3, 4, 5, 6, False] }],

  [{ 'color': ['red','blue','green'] }, { 'background': [] }],          # dropdown with defaults from theme
  [{ 'font': [] }],
  [{ 'align': [] }],

])

pn.Column(full_config).servable()
@yejustme yejustme changed the title The texteditor widget is not working properly: the toolbar can not format the text as designed. The texteditor widget does not work properly: the toolbar can not format the text as designed. Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant