Skip to content
This repository
Browse code

Merge pull request #223 from joelwurtz/patch-2

Fix html5 bug when textarea is required
  • Loading branch information...
commit f786c30894cd605fcd3022ec26a7535e4899003b 2 parents deabf36 + 6dfc22f
Bilal Amarni bamarni authored

Showing 1 changed file with 7 additions and 1 deletion. Show diff stats Hide diff stats

  1. +7 1 Resources/views/Form/jquery_layout.html.twig
8 Resources/views/Form/jquery_layout.html.twig
@@ -60,7 +60,13 @@
60 60
61 61 {%- if configs.script_url is defined %}
62 62
63   - $('#{{ id }}').tinymce($configs);
  63 + var $textarea = jQuery('#{{ id }}');
  64 + if($textarea.is('[required]')) {
  65 + $configs.oninit = function(editor) {
  66 + editor.onChange.add(function(ed, l) { ed.save(); });
  67 + };
  68 + }
  69 + $textarea.tinymce($configs);
64 70 {% else %}
65 71
66 72 tinyMCE.init($configs);

0 comments on commit f786c30

Please sign in to comment.
Something went wrong with that request. Please try again.