Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form validation icon doesn't appear when using input group together. #9

Closed
DJNoblesse opened this issue Aug 22, 2017 · 2 comments
Closed
Labels

Comments

@DJNoblesse
Copy link

DJNoblesse commented Aug 22, 2017

When using input group and form validation(with icon).
form validation is work fine. but, icon doesn't appear right position. (hide back to the button...)

am I write HTML source wrong? or it is a bug?

ScreenShot
Demo Screen (Without Hide Button)
ScreenShot
Demo Screen (With Hide Button)

Here is a source code.

<form>
  <div class="form-group validation validation-icons valid">
    <label class="form-label" for="serialNumber">Serial Number</label>
    <div class="input-group">
      <input class="input" id="serialNumber" placeholder="시리얼 번호 입력" />
      <span class="input-addon-btn">
        <button id="launchQRScanner" class="btn green"><span class="alert-icon"><i class="petalicon petalicon-camera"></i></span></button>
      </span>
    </div>
    <p id="serialNumberNotice" class="form-caption">오른쪽의 버튼을 눌러 QR코드를 스캔할 수 있습니다.</p>
  </div>
</form>

Demo Page : https://devhaus.ikstudio.net/blobs/webview
(form validation status will be always valid on this page.)

@zvuc zvuc added the bug label Aug 22, 2017
@zvuc
Copy link
Collaborator

zvuc commented Aug 22, 2017

This is because validation icons calculate position relative to the direct parent input-group. Using both input-addon-btn along with validation requires nesting input-groups inside input-group like this:

<form>
  <div class="form-group validation validation-icons error">
    <label class="form-label" for="serialNumber">Serial Number</label>
    <div class="input-group">
      <div class="input-group">
        <input class="input" id="serialNumber" placeholder="시리얼 번호 입력" />
      </div>
      <span class="input-addon-btn">
        <button id="launchQRScanner" class="btn green"><span class="alert-icon"><i class="petalicon petalicon-camera"></i></span></button>
      </span>
    </div>
    <p id="serialNumberNotice" class="form-caption">오른쪽의 버튼을 눌러 QR코드를 스캔할 수 있습니다.</p>
  </div>
</form>

However, when I originally implemented validation styles for form-groups, I didn't expect a case where input-groups would be nested like above. So you will need to add an additional line of CSS to override validation icon appearing twice:

.form-group.validation.validation-icons > .input-group:after {
	display: none
}

Demo page: https://codepen.io/zvuc/pen/OjZWVK

I will try to think of a better way to fix the code / documentation to make this work for all cases without breaking existing implementation.

@zvuc
Copy link
Collaborator

zvuc commented Apr 20, 2018

Fixed with d81720a, Released in 0.10.0

@zvuc zvuc closed this as completed Apr 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants