Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16101] LiveView don't apply new classes with Alloy $.resetClass()

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionCannot Reproduce
Resolution Date2020-05-19T16:03:16.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsLiveView
Labelsn/a
ReporterMauro Parra-Miranda
AssigneeUnknown
Created2013-11-24T19:29:28.000+0000
Updated2020-05-19T16:03:16.000+0000

Description

Steps to Reproduce

When I use LiveView in Appcelerator Studio, the $.resetClass() Alloy function don't work… $.resetClass reset all styles but don't add the new class (2nd argument of the function). Example: $.resetClass('myLabel', 'Label Red'); Without LiveView, is work well !

Actual Result

$.resetClass don't apply new classes (reset all styles)

Expected Result

$.resetClass() apply new classes

Attachments

FileDateSize
.log2013-11-24T19:29:36.000+0000684776
diagnostic5684521069383408635.log2013-11-24T19:29:40.000+000021543

Comments

  1. Mauro Parra-Miranda 2013-11-26

    Hello Damien, can you please provide a testcase in the form of single app.js that reproduces the issue? TIA! Best, Mauro.
  2. Mauro Parra-Miranda 2013-11-28

    (from Mostafizur): I have tested this issue with my test code. I got this issue.

    Testing environment:

    OS: MAC OS X 10.8.5 Ti SDK: 3.1.3 GA Ti CLI: 3.2.0 IOS simulator 6.0 and 7.0 Alloy 1.2.2

    Test code

    index.xml

        <Alloy>
       	<Window id="win" layout="vertical" backgroundColor="#fff" top="20">
       		<Button id="button" onClick="addClass"  title="Add Class"/> 
       		<Button id="button" onClick="resetClass"  title="Reset Class"/>
       		<Label id="label" class="Label">Label</Label>
       	</Window>
       </Alloy>
       

    index.tss

        ".coloronly" : {
           color: 'red'
       },
        
       "Label" : {
           color: 'black',
       }
       
       

    index.js

        function addClass() {
       	$.addClass($.label, "coloronly");
       }
       
       function resetClass() {
       	$.resetClass($.label, "coloronly");
       }
       
       $.win.open();
       
       

    Step to test

    Create a new alloy project

    Paste test code in index.js/index.xml/index.tss

    Run on sim 7.0

    Click on 'Add Class’ and 'Reset Class' button and look at label

    No effect in Reset Class Button

    Thanks
  3. Ewan Harris 2020-05-19

    I can't reproduce this on SDK 9.0.1/Alloy 1.14.6

JSON Source