[ALOY-1164] Alloy: Not possible to hide View inside TextArea
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Runtime |
Labels | TCSupport, textarea, view, visible |
Reporter | Matej |
Assignee | Unknown |
Created | 2014-10-08T13:24:29.000+0000 |
Updated | 2018-03-07T22:25:43.000+0000 |
Description
Problem Description
It is not possible to hide a view within TextArea. Properties/Methodsvisible
, hide
, show
are basically ignored. Works fine in Classic Ti and it worked in Alloy too... (I can't say exactly in what version ,but it worked for sure...).
Testcase
index.js
function hideRedView(e) {
$.redView.visible = !$.redView.visible;
console.log("RED VIEW SHOULD BE: " + ($.redView.visible ? "shown" : "hidden"));
};
$.index.open();
index.xml
<Alloy>
<Window>
<TextArea id="textArea">
<View id="redView"/>
</TextArea>
<Button title="Click!" onClick="hideRedView"/>
</Window>
</Alloy>
index.tss
"Window": {
backgroundColor: "white",
layout: "vertical"
}
"#textArea": {
width: "80%", height: 300,
borderWidth: "1px",
borderColor: "gray",
top: 30
}
"#redView": {
width: 100, height: 100,
backgroundColor: "red"
}
Extra information
The Support Team tested this in Ti Classic, is working just fine. The testcase is in a comment.Comments
- Harish Mridha 2014-10-14
Hi,
We tried to reproduce this issue with the given sample test code. It’s a valid bug. It doesn’t work in Alloy but works fine in Ti Classic.
TESTING ENVIRONMENT:
Ti SDK 3.4.0.GA Ti CLI 3.4.0 Alloy 1.5.1 Mac OS X 10.9.5 iOS v8.0TEST CODE:
var win = Ti.UI.createWindow({ backgroundColor:'#fff', layout:'vertical' }); var textArea = Ti.UI.createTextArea({ borderWidth: 2, borderColor: '#bbb', borderRadius: 5, color: '#fff', top: 30, width: '80%', height : 300 }); win.add(textArea); var view = Titanium.UI.createView({ backgroundColor:'red', width:100, height:100 }); textArea.add(view); var aButton = Ti.UI.createButton({ title : 'Click', height : 'auto', width : 'auto', top : 20, }); aButton.addEventListener('click', function() { view.visible = !view.visible; }); win.add(aButton); win.open();
STEPS TO TEST:
- Create a simple project. - Update project with test code - Run on iOS device/ simulatorEXPECTED RESULT:
It’s not working as expected. Thanks - Mauro Parra-Miranda 2014-10-14 [~skypanther]: The original reporter is [~sko]. Thanks!
- Tim Poulsen 2014-10-14 Adding child views to TextArea is supported on only iOS. Even there, our docs recommend to instead use a wrapper view around the TextArea with the "child" view inside that wrapper, overlaying the TextArea. Doing so would be a suitable workaround until we can resolve this issue.