You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by "Justin Mclean (JIRA)" <ji...@apache.org> on 2013/06/18 14:49:20 UTC

[jira] [Reopened] (FLEX-19842) DateField size measured too small

     [ https://issues.apache.org/jira/browse/FLEX-19842?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Justin Mclean reopened FLEX-19842:
----------------------------------

      Assignee: Justin Mclean  (was: Adobe JIRA)
    
> DateField size measured too small
> ---------------------------------
>
>                 Key: FLEX-19842
>                 URL: https://issues.apache.org/jira/browse/FLEX-19842
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: mx: DateField
>    Affects Versions: Adobe Flex SDK 3.2 (Release)
>         Environment: Affected OS(s): All OS Platforms
> Affected OS(s): All OS Platforms
> Language Found: English
>            Reporter: Adobe JIRA
>            Assignee: Justin Mclean
>            Priority: Minor
>
> DateField.measure() has two problems:
> 1. It is a few pixels too small, causing the text field inside it to scroll.
> To reproduce:
> * Create an editable DateField <mx:DateField editable="true" />.
> * Choose a date (say, 01/01/2009).
> * Click somewhere else to move the focus out
> * Click in the DateField again, at the end (to the right of the "9")
> Result: the start of the date "scrolls" away
> Fix: make it 4 pixels wider (in DateField.measure, add an extra "+4" to the "measuredMinWidth = measuredWidth = ..."
> 2. It tries to use 31/12/2004 as a sample date to measure the width, but it does new Date(2004, 12, 31), and months are 0-based there, so it actually uses 31/01/2005. With a date format where the month can be shown as 1 character, this causes the DateField to be one character too small.
> This can be reproduced in Flex 3.2 by having a labelFunction that formats the date like that, or (didn't test) since SDK-15386 the DateField itself also supports formatStrings like D/M/YY.
> Fix: replace it by new Date(2004, 11, 31)
> Workaround for both: override DateField.measure in a subclass, copying the implementation but adding an extra +4 and fixing the month in the date.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira