开发者

Using css, keep button visibility hidden until sibling input expanded or contains text

开发者 https://www.devze.com 2022-12-07 20:40 出处:网络
Got a search component in ReactJS I\'m working on. Here\'s an example https://codepen.io/illusionfactory/pen/ZERwyxv

Got a search component in ReactJS I'm working on. Here's an example https://codepen.io/illusionfactory/pen/ZERwyxv

When the input field has focus, it expands and so does its parent container. The input has a sibling button.

With css (without JS), is it possible to only show the button when a) the input field is expanded, or b) input field has text? Otherwise the button is hidden?

Wondering if it can be done using css, without JS. I was attempting :focus-within on the container and :last-c开发者_如何学运维hild but didn't have much luck.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号