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

Typeahead styles missing? #103

Open
AncientGrief opened this issue Nov 29, 2021 · 1 comment
Open

Typeahead styles missing? #103

AncientGrief opened this issue Nov 29, 2021 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@AncientGrief
Copy link

Maybe I am doing something wrong, but my search results look like this:
image

    <div class="container pt-4">
        <div class="row justify-content-center">
            <div class="col-6 ">
                <div class="input-group">
                    <TypeaheadInput id="in1" class="form-control bg-dark" placeholder="@("Add Item ...")"
                                @ref="refAddItemInput"
                                Data="DataProvider.Items"
                                LabelPropertySelector="x => x.Name"
                                @bind-Value="@AddItemInput"
                                SelectOnBlur="false"
                                OnInput="@(text => {SelectedItemToAdd = null; typeaheadInputValue = text;})"
                                TItem="Item">
                        <ItemTemplate>
                            <div>
                                <label>@context.Name</label>
                            </div>
                        </ItemTemplate>
                    </TypeaheadInput>
                </div>
            </div>
        </div>
    </div>

Using V 1.50 with Visual Studio 2021 .NET 6.0 and Bootstrap 5

The razor css seems to get loaded:
image

Not using <div class="input-group"> changes the result to this:
image

Do I have to add my own styles to
a) Make it the same width as the input and
b) Make it dark style?
c) Make it work with input-group because I want to add a button to the control

@majorimi
Copy link
Owner

majorimi commented Dec 1, 2021

Hi @AncientGrief,
Thanks for contacting me. Unfortunatelly components does not support theming and not tested with every Bootstrap class. But it works with Bottstrap and with some custom CSS your issues can be solved. So the answer:

Do I have to add my own styles to:
a) Make it the same width as the input and? -> It is built in feature just use FitDropdownWidth property set to true.
b) Make it dark style? -> No styling for the dropdown but apply CSS suggested.
c) Make it work with input-group because I want to add a button to the control? -> It looks like input-group is messing with the layout and styling. Simple fix in the custom CSS you can use margin-top.

You can add this CSS to your page or styles whichever fits your need....

<style>
    .dropdown-menu {
		background: black !important;
		margin-top: 40px !important;
    }
</style>

Let me know if you need more help.

@majorimi majorimi added the question Further information is requested label Dec 1, 2021
@majorimi majorimi self-assigned this Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants