creativetimofficial / argon-dashboard

Argon - Dashboard for Bootstrap 5 by Creative Tim
https://www.creative-tim.com/product/argon-dashboard
MIT License
664 stars 1.23k forks source link

[Bug] tags control loses format when there is more than 1 of the the same control in a form #30

Closed laroned closed 4 years ago

laroned commented 5 years ago

Version

1.2.0

Reproduction link

http://na.com

Operating System

Windows 10

Device

windows 10 desktop

Browser & Version

firefox quantum 68.0.1 (64-bit)

Steps to reproduce

1) Copied the following from items.blade.php to new blade page

                            <div class="form-group{{ $errors->has('tags') ? ' has-danger' : '' }}">
                                <label class="form-control-label" for="input-role">{{ __('Tags') }}</label>
                                <select name="tags[]" id="input-role" class="form-control select2{{ $errors->has('tags') ? ' is-invalid' : '' }}" placeholder="{{ __('Tags') }}" data-toggle="select" multiple required>
                                    @foreach ($tags as $tag)
                                        <option value="{{ $tag->id }}" {{ in_array($tag->id, old('tags') ?? []) ? 'selected' : '' }}>{{ $tag->name }}</option>
                                    @endforeach
                                </select>

                                @include('alerts.feedback', ['field' => 'tags'])
                            </div>

2) If i have only one of the above, tag control shows as expected but if i did two tag controls to the same form, the 2nd controls shows items as a list view rather than tag

What is expected?

Multiple tag controls should show up the same in the same form

What is actually happening?

if i have only one of the above, tag control shows as expected but if i did two tag controls to the same form, the 2nd controls shows items as a list view rather than tag


Solution

Additional comments

Can send through screenshot to show behaviour

rarestoma commented 5 years ago

Hi @laroned,

Thank you for working with our products!

Are you using the Laravel Argon Dashboard? Can you please send us a short video so to see exactly what is happening?

All the best, Rares