- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我制作了一个用于输入财务数字的组件,用于我的输入表单。它现在工作得很好,除了一个奇怪的行为:当我点击输入字段时,它会按预期获得焦点,但是当它已经有焦点时点击它会带走焦点。
组件中只有一个 on:click 处理程序,当我删除它时,行为没有改变。所以,我不知道是什么导致了这种奇怪。
<p>Input with precision=2 <Money id=first bind:value=a precision=2/>
<br/>Value={a}</p>
<hr/>
<p>Input with no precision specified <Money ref:m2 bind:value=b/><br/>
Value={b}</p>
<script>
export default {
data(){return {
a:1234.34,
b:3.14159265
}},
components: {
Money : "./Money.html"
}
}
</script>
<style>
/* How to sytle the component*/
:global(#first) {
font-family:serif;
lobal(#first) {
font-family:serif;
background:#ff9;
}
</style>
这是显示问题的 REPL。
https://svelte.technology/repl?version=2.15.3&gist=27f91d57e7a9267fe7d7d36aad850c7e
最佳答案
这是因为 div.focused:before {...}
CSS 在输入前创建了一个伪元素。您可以添加 pointer-events: none
来防止这种情况发生 — example here .
(感谢我们的 Discord chatroom 中的 njb 解决了这个问题——我们有一个支持 channel ,也非常欢迎您前来咨询这些问题!)
关于svelte - 专注于在 Svelte 组件中点击切换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53253431/
menu Home Events Technical Schedule
我试图阻止触发默认 anchor 链接和 onclick 事件。 这是 HTML 代码: Google 我正在尝试使用以下 jQuery 代码阻止任何重定向的发生: $("#mylink").cli
我想在单击父 div 上的任意位置时切换我的 div,除非单击 anchor 元素。因此,例如,如果我单击示例中的第一个文本,我希望它切换,但在我的示例中的第二个文本上,我不希望它切换。 JSFidd
我在通过 jQuery 伪造 anchor 点击时遇到问题:为什么我的thickbox在我第一次点击输入按钮时出现,但第二次或第三次却没有出现? 这是我的代码: Link 当我直接点击链接时,它总是
我已经从 Mootools 切换到 jQuery,因为我认为它有更好的支持。我有这样的 HTML: Opcje Opcje Opcje Opcje Opcje Opcje Opcje JS
我是一名优秀的程序员,十分优秀!