Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Textarea in Panel gets unexpected 140px height style #6764

Open
polarfish opened this issue Nov 27, 2013 · 3 comments
Open

Textarea in Panel gets unexpected 140px height style #6764

polarfish opened this issue Nov 27, 2013 · 3 comments

Comments

@polarfish
Copy link

Issue description

Textareas on page are not being set height style so setting height style for textareas on panel is unexpected behaviour as for me.

Test page

http://jsbin.com/IyeKuFuv/4

Steps to reproduce

Click open panel link.

Expected outcome

Textareas on the page and on slided out panel have the same height.

Actual outcome

Textareas on the page and on slided out panel have different height.

  • Page textarea - 50px (set by textarea.ui-input-text CSS selector)
  • Panel textarea - 140px (set directly to style)

UPDATE in JQM 1.4.0 textarea size normilizes after panel is opened (before your eyes)

Platforms/browsers (including version) and devices tested

Chrome 31, Fedora 19
Chrome 31, Android 4.2.2, Samsung Galaxy Ace 3

jQuery Mobile and jQuery core versions used

JQM - latest
JQ - 1.10.1

@jamesjnadeau
Copy link

My 2 cents.... Who cares

I think what it is doing right now is an excellent default functionality. To me, it currently looks good in each respective place and I'm not sure you should compare them, or force them to be the same.

That being said, the way this styling is applied in a panel, via inline styling, that might need to change, but that's not up to me :)

@gabrielschulhof
Copy link

The problem here is the same as the one with popup. If you attempt to calculate the height of the textarea while its container is truncated (i.e. width: 0 and/or height: 0), you get the wrong value. I don't know why, but you do, even though the element is technically visible, so widths and heights should work correctly.

Popup triggers popupbeforeposition after it has removed the truncation (ui-popup-truncate) from the container. Autogrow handles the popupbeforeposition event and re-calculates the height of the textarea. This is how the height of the textarea comes out correct when the popup opens.

The problem with panel is that it triggers panelbeforeopen before it has removed the truncation class (ui-panel-closed), so, while autogrow does handle that event, it still calculates the wrong height in response to it.

The code path for panel needs to be made identical to the code path for popup in order for the textarea autogrow to work correctly in response to both a popup reveal and a panel reveal.

@jaspermdegroot
Copy link
Contributor

Test page using latest code: http://jsbin.com/sekujuqa/8

@apsdehal apsdehal self-assigned this May 23, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.