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

cleanup function error console #967

Open
RackweLLizm opened this issue Aug 16, 2023 · 5 comments
Open

cleanup function error console #967

RackweLLizm opened this issue Aug 16, 2023 · 5 comments

Comments

@RackweLLizm
Copy link

RackweLLizm commented Aug 16, 2023

aweosome bug

React Version: 17

React-Awesome-Query-Builder Version: 6.2.0

When a selection is made with asyncListValues and the queryBuilder component is closed, the consolda gives this error. I think it is caused by AutoComplete.js file

@ukrbublik
Copy link
Owner

Have you tried to update lib version?

@RackweLLizm
Copy link
Author

Have you tried to update lib version?

@ukrbublik
Yes, I tried but I encountered some problems with Ctx. Vite's error handling part can be really challenging. I was getting an error when I clicked on Add Filter, then I reverted back to version 6.2. I don't know if it gets this error in the latest version, I didn't have the opportunity to check it

@RackweLLizm
Copy link
Author

I only get this error in debug mode. It doesn't give error in production modes

@ukrbublik
Copy link
Owner

Please describe your problem with ctx in newer versions

@RackweLLizm
Copy link
Author

RackweLLizm commented Aug 17, 2023

@ukrbublik

Okay, I'll do what you say.
By the way, I can't change the libraries constantly because there are parts that I intervene. I was having problems with Turkish characters. When I searched in QueryBuilder for characters such as Ş,Ü,İ,Ğ,Ç, there were no results.

valueForFilter.toLocaleLowerCase("TR").indexOf(input.toLocaleLowerCase("TR")) >= 0;

const changeTurkishEnglish = (e) => {
  return e
      .replace(/Ğ/g, "G")
      .replace(/ğ/g, "g")
      .replace(/Ü/g, "U")
      .replace(/ü/g, "u")
      .replace(/Ş/g, "S")
      .replace(/ş/g, "s")
      .replace(/İ/g, "I")
      .replace(/i/g, "I")
      .replace(/ı/g, "I")
      .replace(/Ö/g, "O")
      .replace(/ö/g, "o")
      .replace(/Ç/g, "C")
      .replace(/ç/g, "c")
}

const changeTurkishEnglishArray = (e) => {
  let newArray = e;

  newArray.forEach(c=> {
   c.title = c.title
      .replace(/Ğ/g, "G")
      .replace(/ğ/g, "g")
      .replace(/Ü/g, "U")
      .replace(/ü/g, "u")
      .replace(/Ş/g, "S")
      .replace(/ş/g, "s")
      .replace(/İ/g, "I")
      .replace(/i/g, "I")
      .replace(/ı/g, "I")
      .replace(/Ö/g, "O")
      .replace(/ö/g, "o")
      .replace(/Ç/g, "C")
      .replace(/ç/g, "c")
      return c;
  }
       
  )
 return newArray;
}

172.nci satir: 
nValues = changeTurkishEnglishArray(listValuesToArray(values));

175.nci satir:
newValues = changeTurkishEnglishArray(mergeListValues(asyncListValues, nValues, false));


360.nci satir:
val = changeTurkishEnglish(newInputValue.toLocaleUpperCase("TR")); //const isTypeToSearch = e.type == 'change';

I don't know if this is among your problems, I didn't want to open this as a problem title because I thought it wasn't like this, I fixed it myself, if you want to work on this issue, I can inform you one by one which parts I have corrected in the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants