Reputation: 115
I am using a bootstrap modal to get some information from user. Inside the modal-content
class I have given a <textarea />
field to let user provide comment. This textarea is and should remain resizable. But the problem is when the user resizes the text area and closes the modal, the textarea shows previously changed size and it does not reset to original.
Please follow the link below to reproduce the issue:
Note that CSS resize: none;
is not the option I DO want the textarea should be re-sizable.
Also, I have jquery available, Is there option with jquery to reset the size when the modal closes automatically?
Edit: The duplicate suggestion is different as the textarea here comes within a bootstrap modal.
Upvotes: 1
Views: 320
Reputation: 2123
When the modal
is closed (hidden.bs.modal
event) reset the textarea
height
and width
.
$('#myModal').on('hidden.bs.modal', function() {
$(this).find('textarea').css({'width': '', 'height': ''});
})
Upvotes: 2