vitmalina / w2ui

UI widgets for modern apps. Data table, forms, toolbars, sidebar, tabs, tooltips, popups. All under 120kb (gzipped).
http://w2ui.com
MIT License
2.63k stars 735 forks source link

regex changed in method isAlphaNumeric(val) => ids using paragraph sign are evaluated as invalid #2476

Closed CWeitzen closed 5 months ago

CWeitzen commented 7 months ago

Short description Using the latest version of w2ui (2.0) is not letting us start our project anymore. Function isAlphaNumeric() is returning false for our ids. We use only w3.org suggested characters in our project's ids. I found out that you removed the '§' from your regex. According to [(W3.org)](https://www.w3.org/TR/CSS21/syndata.html#:~:text=In%20CSS%2C%20identifiers%20(including%20element,hyphen%20followed%20by%20a%20digit.) it is a valid character to use in CSS.

What is current behavior Console output : "ERROR: Property "name" has to be alpha-numeric (a-z, 0-9, dash and underscore)." Page not visible.

What is desired behavior w2ui should be initialized as before

Link to jsfidle/codepan with sample code ...

Steps to reproduce or sample use ids that contain '§' in it

vitmalina commented 5 months ago

well, there was no change to isAlphaNumeric for 3 years. Plus it only allows letters and numbers, which paragram is not. What probably happened is now it requires name for controls to be alpha numeric. I wish to keep it that way.

However, I can offer you a couple solutions:

  1. After loading w2ui.js file, you can customize it by overwriting w2utils.checkName function and allow names with paragraphs.
  2. Or you can remove paragraphs from widget names

Thank you!!