2017-09-07 96 views
0

我有一個我從未見過的問題:一個簡單的舊常規html textarea,重點調整焦點。Textarea調整焦點並離開

儘管我設置了所需區域的高度,但它仍然調整爲較小或較大的東西,但沒有明顯的相關性。我試圖刪除所有我沒有運氣的課程。


這是bootstrap的東西嗎?
我該如何解決?

鏈接到問題的簡短視頻:
https://www.dropbox.com/s/7329y5a96ixajl4/18-34-46.wmv?dl=0

<textarea style="min-height: 150px; height: 150px; 
    max-width: 100%;" type="text" name="jobDesc" 
    ng-model="req.jobDesc" placeholder="Write a description for the assignment"> 
</textarea> 
+0

它必須是導致此頁面上的其他CSS,使用你的代碼,並引導其本身3.0不會產生同樣的效果 – Keith

+2

'heigth'應該是'height' – Blazemonger

+0

ARH是的一個類型,wasnt雖然導致了問題 –

回答

1

嘗試使用rows Attribute

<textarea rows="4" > 
This should force the text area to only show 4 lines, or 5, as you desire. 
</textarea> 

無論如何,我認爲你可以檢查你的文字的大小面積或 計算屬性,點擊「檢查」上您的瀏覽器( 示例chrome)。然後點擊樣式/計算,你會看到你正在申請的 樣式。

屬性的圖像:

enter image description here

編輯:

從來就試圖使小提琴想想哪個屬性打破它, 試它。它似乎你需要尋找你的css`s :)內textarea:focus或類似

更改片段顯示padding屬性可怎麼也影響大小

#editor1 {height: 10px;} 
 
#editor1:focus {height: 20px;} 
 

 
#editor2:focus { padding-bottom: 10px;}
<textarea id="editor1" placeholder="Check it!!"></textarea> 
 
<textarea id="editor2" placeholder="Check it!!"></textarea>

解決後改進與OP評論:

I did actually manage to find out what caused the problem. Hidden in one of the js files was some legacy code to manage resizing of textareas. As some of the pages where loading in templates on top of the actual page(in a aside/modal) the code wasnt running correctly. Thank you for taking the time. It led me to my

+0

添加行選項,沒有解決我的問題。是的,我會一直這麼認爲,一定是那個焦點坐在某個地方。但是,我瀏覽了我的所有css文件,但我沒有找到任何東西。 –

+0

嘗試通過css文件去除css文件,是你至少有一個想法的第一種方式。也許這是一個複雜的規則。如果刪除一個css文件它停止改變,檢查裏面的任何關於textarea –

+0

我會嘗試,這實際上不是一個壞主意 –