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
User Input: Can't Delete Search Terms with Keyboard #2900
Comments
IB largely looks good but one thing I'm not clear on:
Why does it matter if there are fewer than the max number of keywords entered? Isn't the idea that if you can focus the text field and backspace in an empty bubble/outside a bubble that it deletes no matter what? I'd think this check would instead be if |
@tofumatt As per the AC, |
Just realised this IB isn't finished, sorry! I'll pause work until it is passed review. My mistake 🙏 |
@asvinb Ah, okay, thanks! Makes sense now. 👍🏻 IB ✅ |
…erms-keyboard User Input: Can't Delete Search Terms with Keyboard (#2900)
QA Update: Fail ❌@johnPhillips when I hit backspace within a word, it will allow me to delete one letter but the cursor then jumps to the end of the word. This is an issue if I am wanting to delete more than one letter within the word. When I hit the backspace once, I should then be able to hit the key again to delete the next letter. Right now, I have to click backspace once to delete the letter, and then click in the word again next to the next letter I want to delete, and hit backspace again. Here's a quick screencast user-input.mp4Verified: Delete a term after entering it, is removed. (e.g. type test, hit comma to enter it, then testing, hitting comma again. Now hit the the backspace and testing is removed, but not test). |
@johnPhillips and I chatted about this and turns out this was an issue even before this fix landed—the way we store the data for these elements in state and then select them causes a known bug with input cursor jumping with controlled components. I found a fix for this and will have a PR soon… it's arguably almost a separate issue but I'll fix it as part of the QA here. 🙂 |
QA Update: Pass ✅On the 5th question, when you enter up to 3 words:
user-input.mov |
Bug Description
When I fill out search terms, I can't then delete them with the backspace/delete key.
Steps to reproduce
Screenshots
Additional Context
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation Brief
/assets/js/components/user-input/UserInputKeywords.js
,BACKSPACE
from@wordpress/keycodes
.deleteKeyword
which does the same thing asonKeywordDelete
.onKeywordDelete
to use thedeleteKeyword
function.onKeyDown
function to:nonEmptyValues
3
and theBACKSPACE
key is pressed, call thedeleteKeyword
function passingnonEmptyValuesLength - 1
as the index to delete.ENTER
orCOMMA
keys are pressed, but this time, having the following selector:#${ slug }-keyword-${ nonEmptyValuesLength - 1 }
Test Coverage
N/A
Visual Regression Changes
N/A
QA Brief
test
, hit comma to enter it, thentesting
, hitting comma again. Now hit the the backspace andtesting
should be removed, but nottest
).Changelog entry
The text was updated successfully, but these errors were encountered: