html - Horizontal textarea scrollbar can't be grabbed in Chrome when border-radius is applied -


https://jsfiddle.net/h4myo11l/4/

<textarea wrap="off" rows="5" style="border-radius: 4px">aaaaaaaaaaa   aaaaaaaaaaa   aaaaaaaaaaa   aaaaaaaaaaabbbbbbbbbaaaaaaaaaaabbbbbbbbbaaaaaaaaaaabbbbbbbbbaaaaaaaaaaabbbbbbbbbaaaaaaaaaaabbbbbbbbb   aaaaaaaaaaa   aaaaaaaaaaa   aaaaaaaaaaa   aaaaaaaaaaa   aaaaaaaaaaa   aaaaaaaaaaabbbbbbbbb   aaaaaaaaaaabbbbbbbbb   aaaaaaaaaaabbbbbbbbb </textarea> 
  1. scroll middle of textbox
  2. try grab horizontal scrollbar mouse
  3. you can't, text cursor , blinks behind bar!

remove border-radius style , repeat: can grab horizontal scrollbar. starts working once scroll bottom.

works fine in firefox. use wrap attribute instead of css because it's cross-browser compatible way including ie11 (html textarea horizontal scroll). using css resulted in return key being pressed in ie11 produce space instead of newline.

is there way fix in chrome?

edit: bug fixed in chrome 52

option 1:

i have faced exact same problem before , have come solution not professional one, job me.

first of all, wrap textarea inside div , set div following properties:

div {     border: 1px solid rgb(169,169,169);  /* default color textearea's border */     border-radius: 4px;                /* border-radius had on text area */     overflow: hidden;                /* prevent textarea's edges overflowing */     display: inline-block;       /* ensure div's border wraps around textarea */ } 

then, remove border textarea , set vertical-align: top rid of sort of padding-bottom exists in elements display: inline-block. so:

textarea {     vertical-align: top; /* remove small gap exists in inline-block elements */     border: 0;    /* remove border textarea */ } 

as said @ beginning, i don't consider professional approach , alternative bug, result visually identical textarea in fiddle. however, use caution it's may behave unexpectedly in 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>    <textarea wrap="off" rows="5">aaaaaaaaaaa      aaaaaaaaaaa      aaaaaaaaaaa      aaaaaaaaaaabbbbbbbbbaaaaaaaaaaabbbbbbbbbaaaaaaaaaaabbbbbbbbbaaaaaaaaaaabbbbbbbbb      aaaaaaaaaaa      aaaaaaaaaaa      aaaaaaaaaaa      aaaaaaaaaaa      aaaaaaaaaaa      aaaaaaaaaaabbbbbbbbb      it's 2016 , cant have horizontal scrollbar on textbox.    </textarea>  </div>


option 2:

after tests, found that, reason, setting position: relative textarea seems solve issue well, @ least in version of chrome, in case want use type of positioning, above job.


Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -