[英]How to avoid primeng button from getting selected when clicked?
I am working with normal buttons from primeng, those buttons get "selected" when clicked.我正在使用primeng的普通按钮,单击时这些按钮会被“选中”。 When I say "selected" I mean that some extra line appears around them and if I click anywhere this "selection" disappears.当我说“选择”时,我的意思是在它们周围出现了一些额外的线,如果我点击任何地方,这个“选择”就会消失。 As my buttons only call a method I do not want them to stay "selected", but I have not found any documentation about this particular property.由于我的按钮只调用一个方法,我不希望它们保持“选中”状态,但我还没有找到任何关于这个特定属性的文档。 I attach as an example the code of some of my buttons, any help is welcome.我附上我的一些按钮的代码作为示例,欢迎任何帮助。
</button> <button pButton pRipple type="button" icon="pi pi-globe"
class="p-button-outlined p-button-rounded" (click)="metodo=listaMetodos.camionesZona"
(click)="busquedas.busqueda=filaSeleccionada.zona"
(click)="this.llamarServicio(listaMetodos.camionesZona);">
</button> ```
This is because the button becomes focused (which is normal behaviour in HTML).这是因为按钮变为焦点(这是 HTML 中的正常行为)。
If you only want to avoid the extra border around the button, then a css-Rule like this might help:如果您只想避免按钮周围的额外边框,那么像这样的 css-Rule 可能会有所帮助:
button:focus {
border: none;
}
I don't know the css settings of primeng buttons, maybe instead of a border there is outline or a shadow.我不知道primeng按钮的css设置,可能不是边框而是轮廓或阴影。 In this case the css-rule should look like this:在这种情况下,css 规则应如下所示:
button:focus {
outline: none;
box-shadow: none;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.