לא מצליח להקליד צבע ספציפי בטקסט הקטגוריה

סיכום מבוסס בינה מלאכותית

A user reported an issue where typing a specific color code in the category text field automatically reverts to a different color. alltiagocom demonstrated the problem with the color code f2f2f2 reverting to ff22ff. dax confirmed the bug and suggested a temporary workaround of copying and pasting the hex value. davidb provided a fix, but alltiagocom reported it was still not working as expected. alltiagocom suggested improvements to the hex code handling, such as ignoring the # symbol and evaluating more than six characters. davidb acknowledged the suggestions and proposed a change to prevent the form from changing the text color value while typing. alltiagocom offered further suggestions to make the hex code input more flexible and user-friendly.

image

I was trying to type f2f2f2, but I can only type f2. The moment I try to type the second f (like f2f) it reverts to ff22ff automatically. This happens on both the Color and Text Color when trying to create a new category (or editing it).

4 לייקים

תודה על הדיווח. אני יכול לשחזר גם במטא. יתר על כן, אי אפשר למחוק את מה שהקלדת באמצעות לחצן החזרה במקלדת.

כפתרון עוקף זמני בזמן שאנו פותרים בעיה זו, באפשרותך להעתיק ולהדביק את ערך ה-hex ישירות לשדה.

6 לייקים

It should be fixed with this commit:

https://github.com/discourse/discourse/commit/3c82f1bf98740077cea30285edcbbb213494f00c

5 לייקים

תודה שיידעת אותנו, דוד.

I believe I have everything updated, but still not working:

I’m not a developer, so I don’t know this on a deeper level, but looking at the commit, it says:
// auto fill common hex codes like #F8F -> #F8F8F8 and #DDD -> #DDDDDD

Why would it behave this way?
I see how adding fff and hitting save would automatically save as ffffff, but while typing, there should be no auto fill happening in real time (if that’s what’s happening).

What if I want to type f2ff32? Right now, I’m stuck to it always defaulting to f2f2f2, which was the issue on my OP.

לייק 1

I took a shot at improving the suggestions from the autocomplete hex feature initially. Though I think the only real solution here is to prevent the form from changing the text color value while you are typing.

We do still need to check the value to try and ensure we have a valid hex code, but I’ve changed the approach so that it only checks the value if you click or tab out of the field or when submitting the form.

Hopefully this change will work better for you:

https://github.com/discourse/discourse/commit/202493cbeca15ed1700fe51516531fea3575a367

3 לייקים

אני אעדכן ואודיע לך. תודה.

ההצעה שלי:

  • הוא תמיד מעריך את 6 התווים הראשונים, כך שגם אם יש לי f2f299f2, הוא יניח שזה f2f299.
  • הוא יכול להתעלם לחלוטין מ-#, שזה לפעמים מה שאנחנו מקבלים מאפליקציות מסוימות (לדוגמה, Shottr נותן לי את כל ה-#f2f2f2). זה מאפשר לאנשים פשוט להשתמש בכל מה שהם מקבלים מאפליקציה או אפילו איך שהם רגילים להקליד את קוד ה-hex. אז הקלדה/הדבקה של #f2f2f2, f2f2f2, #f2f2f29393, או f2f2f29393 יקבלו את אותו הצבע.

שתי הגישות הללו יהפכו אותו לגמיש במיוחד. אם אני מקבל #f2f2f2 מאפליקציה, זה לא יקצץ את ה-2 האחרון, כי זה לא מוגבל רק ל-6 תווים, וזה עדיין יקבל את זה כצבע, כי זה מתעלם מה-#.

ואז איפה שהוא שומר, הוא מסיר את ה-# ואת כל התווים הנוספים מעל 6.

מה דעתך?

לייק 1

נושא זה נסגר אוטומטית לאחר 3 ימים. לא ניתן להוסיף תגובות חדשות.