Horizontal Textarea Scrollbar Can't Be Grabbed In Chrome When Border-radius Is Applied
Solution 1:
As said in my comment position:relative;
fixes the issue with the scrollbar.
Another option you could try is to set the border
to none and use box-shadow
instead to give close to the same effect
I've included three examples in this fiddle of the different options to try: https://jsfiddle.net/p6jw6qvf/
#one{
border: none;
box-shadow: 005px2px#9a9a9a;
}
#two{
position: relative;
border-radius: 4px;
}
Note: if you go with option #two this positions the scrollbars ontop and causes them to sit over the border see image, to fix this you can use custom scrollbars to add border-radius to the scrollbar itself.
Solution 2:
• OPTION 1:
I have faced the exact same problem before and I have come up with a solution which is not the most professional one, but does the job for me.
First of all, wrap your textarea
inside a div
and set for your div
the following properties:
div {
border: 1px solid rgb(169,169,169); /* The default color for the textearea's border */border-radius: 4px; /* The border-radius you had on the text area */overflow: hidden; /* To prevent the textarea's edges from overflowing */display: inline-block; /* To ensure the div's border wraps around the textarea */
}
Then, remove the border from the textarea
and set vertical-align: top
to get rid of that sort of padding-bottom
that exists in elements with display: inline-block
. Like so:
textarea {
vertical-align: top; /* To remove the small gap that exists in inline-block elements */border: 0; /* To remove the border from the textarea */
}
As I said at the beginning, I don't consider this a very professional approach and alternative to this bug, but the result is visually identical to the textarea
in your fiddle. However, use it with caution as it's likely that it may behave unexpectedly in some situations.
Working fiddle: → here.
Snippet:
div {
border: 1px solid rgb(169, 169, 169);
border-radius: 4px;
overflow: none;
display: inline-block;
}
textarea {
vertical-align: top;
overflow-x: visible;
border: 0;
}
<div><textareawrap="off"rows="5">aaaaaaaaaaa
aaaaaaaaaaa
aaaaaaaaaaa
aaaaaaaaaaabbbbbbbbbaaaaaaaaaaabbbbbbbbbaaaaaaaaaaabbbbbbbbbaaaaaaaaaaabbbbbbbbb
aaaaaaaaaaa
aaaaaaaaaaa
aaaaaaaaaaa
aaaaaaaaaaa
aaaaaaaaaaa
aaaaaaaaaaabbbbbbbbb
IT'S 2016 AND I CANT EVEN HAVE A HORIZONTAL SCROLLBAR ON A TEXTBOX.
</textarea></div>
• OPTION 2:
After some tests, I found that, for some reason, setting position: relative
to the textarea
seems to solve the issue as well, at least in my version of Chrome, but in case you want to use another type of positioning, the above will do the job.
Post a Comment for "Horizontal Textarea Scrollbar Can't Be Grabbed In Chrome When Border-radius Is Applied"