bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

When using input-group splits when form.field is added

Open jbhrfx9280 opened this issue 1 year ago • 3 comments

Prerequisites

Describe the issue

         <div class="input-group input-group-sm mb-1">
            <span class="input-group-text">With textarea</span>
            {{ form.social_title }}
            <textarea class="form-control" aria-label="With textarea"></textarea>
          </div>

See below example with {{ form.field }} added image

FYI - I'm new to bootstrap 5 and HTML design, more of a coder so clearly I can be doing this wrong. Framework: Django

Reduced test cases

         <div class="input-group input-group-sm mb-1">
            <span class="input-group-text">With textarea</span>
            <textarea class="form-control" aria-label="With textarea"></textarea>
          </div>

see below without form.field added

image

What operating system(s) are you seeing the problem on?

Windows

What browser(s) are you seeing the problem on?

Chrome, Microsoft Edge

What version of Bootstrap are you using?

5.3.3

jbhrfx9280 avatar Sep 18 '24 15:09 jbhrfx9280

Hello @jbhrfx9280. Bug reports must include a live demo of the issue. Per our contributing guidelines, please create a reduced test case on CodePen or StackBlitz and report back with your link, Bootstrap version, and specific browser and Operating System details.

github-actions[bot] avatar Sep 18 '24 17:09 github-actions[bot]

Changing behavior to the textarea

<div class="input-group input-group-sm mb-1">
    <span class="input-group-text">With textarea</span>
    <textarea class="form-control" id="myTextarea" aria-label="With textarea"></textarea>
</div>
<button id="btn">Set Text</button>
**And handling form data from textarea**
<script>
    document.getElementById('submitBtn').addEventListener('click', function() {
        let textareaValue = document.getElementById('myTextarea').value;
        console.log('Textarea value:', textareaValue);
        // You can then do something with the textarea value like validation or sending it via AJAX
    });
</script>

AadiSharma49 avatar Sep 19 '24 19:09 AadiSharma49

I am wild guessing, that the form tag {{ form.social_title }} is being replaced with 'title text' element with the class class="form-control" causing the issue cum as intended for "input-group".

And what exactly are you trying to achieve? Trying to set placeholder text for the textarea?

omishah avatar Sep 20 '24 12:09 omishah

As the issue was labeled with awaiting-reply, but there has been no response in 14 days, this issue will be closed. If you have any questions, you can comment/reply.

github-actions[bot] avatar Oct 05 '24 00:10 github-actions[bot]