uniapp开发中输入手机验证码时,在微信小程序真机测试中无法隐藏光标的问题

技巧是用绝对定位,left和width把光标移除屏幕。

/* 隐藏的真实输入框 */
.code-input-hidden {
	position: absolute;
	left: -100%;
	top: 0;
	width: 200%;
	height: 100%;
	opacity: 0;
	z-index: 10;
	font-size: 1rpx;
	border: none;
	outline: none;
	background: transparent;
	-webkit-appearance: none;
	appearance: none;
	padding: 0;
	margin: 0;
	pointer-events: auto;
	caret-color: transparent;
	color: transparent;
	text-shadow: none;
}

Comments

No comments yet. Why don’t you start the discussion?

发表回复