工作,我有使用Flex-箱「隱藏」屬性不與柔性盒
<!DOCTYPE html>
<polymer-element name='test-flex'>
<template>
<style>
.lab-flex-col-container {
display: flex;
flex-flow: column;
align-content: center;
background-color: gold;
border-radius:5px;
margin: 5px;
}
.lab-flex-col {
display:flex;
flex-flow:column;
align-self:center;
margin:5px;
}
.margin2 { margin: 2px; }
</style>
<form id='form'
class='form'>
<div class='lab-flex-col-container'>
<div class='lab-flex-col' id='hidden-does-not-work' hidden>
<input id='hidden-works' type='text'>
</div>
<div id='hidden-works' hidden>
<textarea></textarea>
</div>
<div id='hidden-does-not-work-here-either' class='lab-flex-col' hidden>
<button>Save</button>
</div>
</div>
</form>
</template>
<script type="application/dart;component=1">
import 'package:polymer/polymer.dart';
import 'dart:html';
@CustomTag('test-flex')
class TestFlex extends PolymerElement
{
TestFlex.created() : super.created();
ready()
{
$['hidden-does-not-work'].hidden = true;
}
void syncDb (Event e, var detail, var target)
{
}
@override
void enteredView()
{
super.enteredView();
$['hidden-does-not-work-here-either'].hidden = true;
}
}
</script>
</polymer-element>
爲什麼實驗室-FLEX-COL類的存在阻止了文本輸入的隱藏在下面的代碼? 我試過隱藏='隱藏',這也不起作用。
當textarea元素中隱藏時,它按預期方式工作,但是一旦添加了flex-box類,它就停止工作並且元素保持可見。