-
Notifications
You must be signed in to change notification settings - Fork 203
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
Fixes #2422 - Add autogrow to bugform steps to reproduce field #2442
Conversation
r? @miketaylr |
webcompat/static/js/lib/bugform.js
Outdated
var rowHeight = | ||
target.dataset.rowHeight || | ||
contentHeight / parseInt(target.getAttribute("rows"), 10); | ||
// don't let textarea grow more than half the screen size |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This was tested on http://localhost:5000/issues/new
|
@karlcow: Have you deleted your cache? I needed to force clear my browser caches. After that it works fine for me in Chrome, Firefox, Safari and Edge. |
Aha! It's not working as expected, when pasting in longer text. Will check that immediately! |
Sorry, I've been swamped with other stuff. Will try to find the time for review tomorrow! |
…ent height, if content is higher.
So I made a few adjustments to have everything set up and calculated correctly. From my side it should be good now: entering text manually and pasting text in increases the text fields height. Are there any more opinions on @zoepage's comment? |
@Regaddi Speaking to myself, and creating long comments all the time, the more I can maximize, the better for me. So limiting to an height is not a very good fit for me. Having real estate for working out the prose is good. |
Reading again carefully @zoepage comment to be sure I don't misinterpret it.
Maybe the criteria is not the screen height. Probably the thing which matters is the browser height. For example, this is me right now for a comment I have not yet finished. The height of this screenshot is 3162px and if the comment is getting longer I will probably stretch it even more depending if it helps me to understand visualize my comments with the code. Hope it helps. So to rephrase my habits: I maximize the textarea for the current browser height when having long comments of code. |
Just testing out the current PR... it seems good to me?
Why would we want to limit the height of the textarea? We can always scroll up the page, and that's less annoying than scrolling within a textarea, IMO. (maybe I misunderstand) IMO, we should merge this now, and file a follow up bug to improve it if we feel like there's some UX improvements to be gained after experience using it. |
Ping @karlcow. Any objections to merging now? |
ah missed it. Not tested yet. but let's merge and learn from it. |
r? @zoepage
I decided to expand and reduce the textarea based on the text rows. I set the maximum height to
window.innerHeight / 2
as a first best guess, but I'm open to other opinions. If needed we can also make this configurable (e.g. by using a data-attribute on the field).I also pushed these bits of code into the
bugform.js
file, but maybe the functionality should be extracted later on (comparable issue like #2268).