mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-31 01:09:22 +02:00
[Performance] Calculate height instead of letting the browser do it
This commit is contained in:
@@ -285,8 +285,11 @@ export function uiSectionRawTagEditor(id, context) {
|
||||
if (_tagView !== 'text') return;
|
||||
|
||||
var selection = d3_select(this);
|
||||
selection.style('height', null);
|
||||
selection.style('height', selection.node().scrollHeight + 5 + 'px');
|
||||
var matches = selection.node().value.match(/\n/g);
|
||||
var lineCount = 2 + Number(matches && matches.length);
|
||||
var lineHeight = 20;
|
||||
|
||||
selection.style('height', lineCount * lineHeight + 'px');
|
||||
}
|
||||
|
||||
function stringify(s) {
|
||||
|
||||
Reference in New Issue
Block a user