giorgi94 / django-editor-widgets

This package provides some custom widgets to use monaco or tinymce editors in django admin.
15 stars 11 forks source link

Editor height definition #5

Open danmaxis opened 3 months ago

danmaxis commented 3 months ago

First, thank you for developing and maintaining the django-editor-widgets library. It has been incredibly useful, and thanks for the effort you've put into it.

I'd to suggest an enhancement to the MonacoEditorWidget. Specifically, it would be extremely helpful if the height of the Monaco editor could be made customizable directly through a parameter during the widget's initialization. Alternatively, it would be beneficial if the widget could derive its height from the associated textarea, whose value is defined by the attrs parameter.

If there is already a way to define widget height in a simpler manner, could you write it below?

In my current use case, I need to set different heights for various fields using the Monaco editor, and having this flexibility would greatly simplify the implementation.

Thank you very much. I believe it would be a valuable addition to the library, and I'm sure other users would find it useful as well.

giorgi94 commented 2 months ago

Sorry for the late response, and thank you for your kind words and valuable suggestion. I've been occupied with other projects lately, but I am planning to add new features to the package in the future, and your suggestion is definitely interesting.

In the meantime, you can override the djangoeditorwidgets/monaco/monaco.config.js file in your project and implement your own logic during the initialization process to customize the height of the Monaco editor.

Thanks again for your input!