flaviusmatis / flaviusmatis/flexibleArea.js

Bug in chrome and javafx

Open
#4 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
34
Forks
12
PR merge metrics
No merged PRs in 30d

Description

The trigger('updateHeight') doesn't work in my web app when I'm using it in chrome or the javafx browser but is ok in firefox. (It works with a simple example.)
I could solve it by changing the setHeightAndOverflow function by setting again the lineheight (because it was NaN).

``` javascript
function setHeightAndOverflow(){
lineHeight = parseInt($textarea.css('line-height'), 10) || parseInt($textarea.css('font-size'), 10);
var cloneHeight = $clone.height();
var overflow = 'hidden';
var height = hasBoxModel ? cloneHeight + lineHeight + heightCompensation : cloneHeight + lineHeight;
if (height > maxheight) {
height = maxheight;
overflow = 'auto';
} else if (height < minheight) {
height = minheight;
}
if ($textarea.height() !== height) {
$textarea.css({'overflow': overflow, 'height': height + 'px'});
}
}
```

Regards

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating setHeightAndOverflow and reproduce trigger('updateHeight') in Chrome and the JavaFX browser, comparing the result with Firefox. Check the lineHeight value and the resulting textarea height; done means the update behaves consistently across the reported browsers without breaking the simple example.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, jquery
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.