From 933834c4a60610710fc949daa2e15531c2c45780 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Mon, 1 Feb 2016 16:55:00 -0500 Subject: Allow manual resize of js-autosize textareas First, the autosize library was being too controlling and removed the `resize` property from any elements to which it was attached, removing the drag handle. Second, we detect when the user manually resizes an autosize textarea, and then remove the autosize behavior from it and increase its max-height. This should allow for the best of both worlds. Closes #12832 --- spec/javascripts/behaviors/autosize_spec.js.coffee | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 spec/javascripts/behaviors/autosize_spec.js.coffee (limited to 'spec/javascripts') diff --git a/spec/javascripts/behaviors/autosize_spec.js.coffee b/spec/javascripts/behaviors/autosize_spec.js.coffee new file mode 100644 index 00000000000..7fc1d19c35f --- /dev/null +++ b/spec/javascripts/behaviors/autosize_spec.js.coffee @@ -0,0 +1,11 @@ +#= require behaviors/autosize + +describe 'Autosize behavior', -> + beforeEach -> + fixture.set('') + + it 'does not overwrite the resize property', -> + load() + expect($('textarea')).toHaveCss(resize: 'vertical') + + load = -> $(document).trigger('page:load') -- cgit v1.2.1