集合下拉列表默认空白值

时间:2019-04-19 07:48:26

标签: crystal-lang amber-framework

如何在选择字段(琥珀色框架)中添加默认空白值?

== select_field(名称:“ parent_category_id”,集合:Category.all.map {| category | [category.id,category.name]},已选择:“”,类:“ form-control”)

1 个答案:

答案 0 :(得分:0)

利用可以连接晶体阵列的事实:

   override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)

        DispatchQueue.main.async {
            self.searchController.searchBar.becomeFirstResponder()
        }
    }