Topic: Autocomplete is not showing the results if the words are not matched with the data array

Venky free asked 5 years ago


Expected behavior

When user enters some text in the input field and even if any of the words is wrong still the autocomplete should show the results. Please check the screenshot for the same.

Actual behavior

When user enters a wrong word in the input it results to no autocomplete display. For example, consider the code snippet in the resources section.

When try to run that component with a input something like what is my ip, the autocomplete is populating the results, but when one of the words has typo mismatch what is ym ip (instead of my it's ym) then autocomplete is not showing any results. Please find the screenshot for the same.

I guess the autocomplete module is trying to match exact word and populating the results, rather can we've a functionality like whether the words are included in the given text or not.

This be a new feature which is not there in the current component that the autocomplete is comes with the bold words when the user types in some text in the input field.

The final outcome which we are expecting is like this.

Please let me know for any further concerns on the same.

Thanks :)

Resources (screenshots, code snippets etc.)

import React, { Component } from "react";
import { MDBContainer, MDBAutocomplete } from "mdbreact";

const data = [
    "what is my ip",
    "What is my ipv4",
    "What is my ipv6",
    "What is my public ip",
    "What is my public ipv4",
    "What is my public ipv6"
];

class Autocomplete extends Component {

    logValue = value => {
        console.log(value);
    };

    render() {

        return (

            <MDBContainer>
                <MDBAutocomplete
                    data={data}
                    label="Choose your favorite state"
                    clear
                    id="input"
                    getValue={this.logValue}
                />
            </MDBContainer>

        );

    }

}

export default Autocomplete;

Autocomplete spell checkAutocomplete


Konrad Stępień staff answered 5 years ago


Hi @Venky,

Thank you for good suggestion, and I did pass this to the right person.

However, you have to wait because the topic is to discuss not only for the technology of the react , but also for angular, vue and jQuery.

Best regards, Konrad. :)


Venky free commented 5 years ago

Hi,

Can we've any update on this.

Thanks :)


Konrad Stępień staff commented 5 years ago

Hi @Venky,

I forward it to angular, vue and jQuery team and it is on a our ToDo list.

It may take some time because we also need to check if it works in jquery technology.

Best regards, Konrad.



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Resolved

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB React
  • MDB Version: 4.18.0
  • Device: Any
  • Browser: Any
  • OS: Any
  • Provided sample code: No
  • Provided link: Yes