输入在用户开始输入时收缩 [英] Input shrinks when user starts typing
问题描述
我的网站上的联系人字段只要用户在移动设备上开始输入时就会缩小。我无法在任何尺寸的桌面浏览器窗口中检测到此行为。
contactfield由相对新的 如何重新创建错误: 我已经尝试过通过对输入应用 我在电子表格中收集了关于不同浏览器和设备的信息,以查明错误是否出现。 我想尝试让浏览器公司收到通知,看看是否是浏览器错误,以便他们能够修复它... 这个问题可能是由 相反,将每个 给每个 The contactfields on my website are shrinking as soon as the user starts typing on a mobile device. I could not detect this behavior in a desktop browser window at any size. The contactfield is structured with the relativly new How to recreate the bug:
I already tried to fix it trough applying a I gathered information in a spreadsheet about different browsers and devices to find out wether the bug appears or not. https://docs.google.com/spreadsheets/d/1D3_7zh8u2MFAx5vt_mKCA9bjEI9crdDwwOSlucLLwfM/edit?usp=sharing I think that it might be a browser bug since I would like to try to get the browser companies notified if it appears to be a browser bug so they can fix it...
The problem may be caused by Instead, wrap each Give each 这篇关于输入在用户开始输入时收缩的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! css网格$ c
$ b
$ b
宽度
和 min-width
来解决它,但是这并没有解决它。
/ *我实际上使用SCSS,所以这段代码不会运行* // * grid * /。grid__form {display:grid ;网格模板列:50%50%; grid-template-areas:name emailtextarea textareafeedback submit; grid-gap:10px; @media screen和(max-width:500px){grid-template-columns:100%; grid-template-areas:feedbacknameemailtextareasubmit;} / *联系表格* /。contact {grid-area:contact; margin-bottom:100px; & __ header {font-size:500;颜色:$ text-dark-primary; font-size:2rem; text-align:center;保证金:0 0 30px 0; @media screen和(max-width:500px){font-size:1.5rem; }& - link {text-decoration:none;颜色:rgba($ color-secondary-400,0.87);光标:指针;过渡:$ transition-standard; @media屏幕和(最大宽度:359px){font-size:1.3rem; }&:hover {text-decoration:underline; }}}& __ input {font-family:'Roboto','Noto Sans',sans-serif;行高:1.5; font-size:1rem;填充:0.5em; border:2px solid rgba(black,0.20); border-radius:2px;宽度:100%;最小宽度:100%;颜色:$ text-dark-primary;背景颜色:白色;光标:文本;概要:无;过渡:$ transition-standard; & - name {grid-area:name; }& - email {grid-area:email; }& - textarea {grid-area:textarea;调整大小:无; min-height:250px; }&:focus {border:2px solid $ color-secondary-200;宽度:100%;最小宽度:100%; }}& __ submit {font-family:'Roboto','Noto Sans',sans-serif;行高:1.5;网格区域:提交; justify-self:end; }& __ feedback {grid-area:feedback; align-self:center;保证金:0; font-size:1rem; font-weight:500; }}
< form class =contact_form grid__formaction =_ assets / php / sendMail.phpmethod =POSTnovalidate> < input id =nameclass =contact__input contact__input - nametype =textname =nameplaceholder =Name/> < input id =emailclass =contact__input contact__input - emailtype =emailname =emailplaceholder =Email/>
输入
在div中。这些div现在变成了网格项目,并且输入变成了他们的子项(并且现在不在网格布局的范围之内)。
输入
a 宽度:100%
,如有必要。css grid
.
width
and min-width
to the inputs but this did not fixed it.css grid
is relatively new?! Are you able to recreate the bug? Do you have any ideas how to fix it other than removing the css grid
and structuring it with flexbox
?/*I actually use SCSS so this code will not run */
/* The grid */
.grid__form {
display: grid;
grid-template-columns: 50% 50%;
grid-template-areas: "name email" "textarea textarea" "feedback submit";
grid-gap: 10px;
@media screen and (max-width: 500px) {
grid-template-columns: 100%;
grid-template-areas: "feedback" "name" "email" "textarea" "submit";
}
/* The contact form */
.contact {
grid-area: contact;
margin-bottom: 100px;
&__header {
font-size: 500;
color: $text-dark-primary;
font-size: 2rem;
text-align: center;
margin: 0 0 30px 0;
@media screen and (max-width: 500px) {
font-size: 1.5rem;
}
&--link {
text-decoration: none;
color: rgba($color-secondary-400, 0.87);
cursor: pointer;
transition: $transition-standard;
@media screen and (max-width: 359px) {
font-size: 1.3rem;
}
&:hover {
text-decoration: underline;
}
}
}
&__input {
font-family: 'Roboto', 'Noto Sans', sans-serif;
line-height: 1.5;
font-size: 1rem;
padding: 0.5em;
border: 2px solid rgba(black, 0.20);
border-radius: 2px;
width: 100%;
min-width: 100%;
color: $text-dark-primary;
background-color: white;
cursor: text;
outline: none;
transition: $transition-standard;
&--name {
grid-area: name;
}
&--email {
grid-area: email;
}
&--textarea {
grid-area: textarea;
resize: none;
min-height: 250px;
}
&:focus {
border: 2px solid $color-secondary-200;
width: 100%;
min-width: 100%;
}
}
&__submit {
font-family: 'Roboto', 'Noto Sans', sans-serif;
line-height: 1.5;
grid-area: submit;
justify-self: end;
}
&__feedback {
grid-area: feedback;
align-self: center;
margin: 0;
font-size: 1rem;
font-weight: 500;
}
}
<form class="contact__form grid__form" action="_assets/php/sendMail.php" method="POST" novalidate>
<input id="name" class="contact__input contact__input--name" type="text" name="name" placeholder="Name" />
<input id="email" class="contact__input contact__input--email" type="email" name="email" placeholder="Email" />
<textarea id="message" class="contact__input contact__input--textarea" type="text" name="message" placeholder="Message"></textarea>
<p class="contact__feedback"></p>
<button class="contact__submit button--raised" type="submit">submit</button>
</form>
input
elements as grid items. Some browsers may be quirky with form elements in a grid container, being that this technology is so new.input
in a div. These divs now become the grid items and the inputs become their children (and are now outside the scope of grid layout).input
a width: 100%
, if necessary.