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

[BUG] Input-icon with form-control-plaintext #1816

Open
jchine opened this issue Jan 24, 2024 · 0 comments
Open

[BUG] Input-icon with form-control-plaintext #1816

jchine opened this issue Jan 24, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jchine
Copy link

jchine commented Jan 24, 2024

Browser

Firefox 121.0.1, Chrome 120.0.6099.225, Edge 120.0.2210.114 (any browser)

OS

Windows 10

Screen size

1920x1080

Describe the bug

There are no classes that relate .input-icon with .form-control-plaintext.
When used together, the icon appear above the text

How to reproduce

  1. Create
<div class="mb-3">
  <label class="form-label">Icon input</label>
  <div class="input-icon mb-3">
    <div class="form-control-plaintext">Input value</div>
    <span class="input-icon-addon">
         <svg xmlns="http://www.w3.org/2000/svg" class="icon alert-icon" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
        <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
        <path d="M12 9v2m0 4v.01"></path>
        <path d="M5 19h14a2 2 0 0 0 1.84 -2.75l-7.1 -12.25a2 2 0 0 0 -3.5 0l-7.1 12.25a2 2 0 0 0 1.75 2.75"></path>
      </svg>
    </span>
  </div>
  <div class="input-icon mb-3">
    <span class="input-icon-addon">
      <svg xmlns="http://www.w3.org/2000/svg" class="icon alert-icon" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
        <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
        <path d="M12 9v2m0 4v.01"></path>
        <path d="M5 19h14a2 2 0 0 0 1.84 -2.75l-7.1 -12.25a2 2 0 0 0 -3.5 0l-7.1 12.25a2 2 0 0 0 1.75 2.75"></path>
      </svg>
    </span>
    <div class="form-control-plaintext">Input value</div>
  </div>
</div>
  1. Solution
    Add class in src/scss/ui/forms/_form-icon.scss
  .form-control-plaintext:not(:last-child) {
    padding-right: 2.5rem;
  }

  .form-control-plaintext:not(:first-child) {
    padding-left: 2.5rem;
  }

Screenshots

No response

JSFiddle

No response

@jchine jchine added the bug Something isn't working label Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant