Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16535] MobileWeb: Button.js issue with missing font property and inconsisent treatment of whitespace characters in title

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-03-31T22:36:47.000+0000
Affected Version/sRelease 3.2.1
Fix Version/s2014 Sprint 07, 2014 Sprint 07 Tooling, Release 3.3.0
ComponentsMobileWeb
Labelsmodule_button, qe-testadded
ReporterAndrew Greenstreet
AssigneeChris Barber
Created2014-02-24T17:54:57.000+0000
Updated2014-06-19T12:44:43.000+0000

Description

On Mobile Web Buttons have two deficiencies. 1. Buttons are missing a font property, so you can't change the font size or face. 2. Buttons do not treat leading spaces in the "title" the same as other platforms. HTML ignores the spaces, so button.title = " Some Text" would be treated as if it were button.title = "Some Text". This is not true on Android or iOS I'm combining these as I have a fix I'll submit as a pull request.

Comments

  1. Andrew Greenstreet 2014-02-24

    Fixed in: https://github.com/appcelerator/titanium_mobile/pull/5370
  2. Ritu Agrawal 2014-02-24

    Thank you so much for submitting this pull request. In order for us to evaluate this pull request, we need a simple runnable test case illustrating the current issue so that we then can use the PR to verify that the issue has been fixed indeed. Again, we appreciate your effort and hard work.
  3. Ritu Agrawal 2014-03-03

    Moving this ticket to engineering to evaluate this PR in the context of this ticket.
  4. Chris Barber 2014-03-31

    [~andrew@gstreetmedia.com] Why would you have whitespace at the beginning of a line of text in a button? Are you doing this for alignment, perhaps when the button has an icon?
  5. Andrew Greenstreet 2014-03-31

    That is exactly the reason why. I only offered this up for parity, as in Android or iOS if you add whitespace characters to a button with an icon, the text will shift right. HTML will ignore the double whitespace and treat it as a single space.
  6. Chris Barber 2014-03-31

    [~andrew@gstreetmedia.com] Hmm, ok. I'm fine with inserting  , but we may also want to increase the default padding.
  7. Chris Barber 2014-03-31

  8. Chris Barber 2014-03-31

    3_2_X_hybrid pull request: https://github.com/appcelerator/titanium_mobile/pull/5561
  9. Samuel Dowse 2014-05-15

    Verified fixed on: Mac OSX 10.9.3 Appcelerator Studio, build: 3.3.0.201405121247 Titanium SDK, build: 3.3.0.v20140515133312 Titanium CLI, build: 3.3.0-dev Alloy: 1.4.0-alpha Leading whitespace is displayed correctly. Fonts are also recognised, chrome not displaying Helvetica-Light due to the browser not supporting it. Firefox successfully displays the font though. Closing.

JSON Source