Firefox won't show scrollbars for 2 row textarea

前端 未结 3 465
故里飘歌
故里飘歌 2021-01-24 13:18

Firefox will not show a scrollbar in a 2 line textarea if I set the height so that only two rows are actually displayed. I have to make it big enough to show part of the line be

相关标签:
3条回答
  • 2021-01-24 13:38

    Chrome handles this well so I have added the testcase to an existing bug here.

    0 讨论(0)
  • 2021-01-24 13:42

    In firefox, even you set height for textarea manually, the textarea can still be changing height by click and drag the corner. Actually there is a symbol around the corner indicates such changing height ability. So you don't have to worry about it. Maybe set a bigger height for it is better.

    0 讨论(0)
  • 2021-01-24 13:47

    There is no workaround possible, you're simply trying to fit an elephant in a tea cup. Below a given threshold, somewhere around 35 pixels depending on system and browser, there just isn't room anymore for an identifiable scrollbar. Firefox decides to hide it instead, Chrome just removes the scroll thumb - both mean it's not usable.

    To make it appear, actually give it enough height to have one.

    On a semi-related note, you can set resize:none in CSS to make a textarea element have static size instead of the resizable corner in the bottom right. This also gives it slightly more room to fit a scrollbar, but in normal situations there's still not enough room at a height of just 30 pixels.

    0 讨论(0)
提交回复
热议问题