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

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

Closed
3 tasks done
jbhrfx9280 opened this issue Sep 18, 2024 · 4 comments
Closed
3 tasks done

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

jbhrfx9280 opened this issue Sep 18, 2024 · 4 comments

Comments

@jbhrfx9280
Copy link

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

Copy link
Contributor

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.

@AadiSharma49
Copy link

AadiSharma49 commented Sep 19, 2024

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>

@omishah
Copy link

omishah commented Sep 20, 2024

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?

Copy link
Contributor

github-actions bot commented Oct 5, 2024

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 github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants