-
Notifications
You must be signed in to change notification settings - Fork 329
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
StringArrayEditor revision and update #3469
Conversation
Working on changes for new tag structure and making css adjustments to accomodate that. But also, just removed some unneeded styles. Need to continue work for new structure, and the entire file can likely be simplified/slimmed down further.
add keyboard interactions
I see what you mean but I think the added clutter negates most of the benefit. |
Additional to the clutter aspect, this creates the risk that a user will enter a tag into the wrong field. Compare the combo field, where typing "ad" filters the droplist to |
This is kind of along the lines of what I was thinking when I wrote "Is there any way to trim it [the datalist] down initially with just the major categories or something, and then transition to the full list once the user starts typing?" I.e. make the datalist a two-step process, first picking the scheme and second filling out the tag name. Though I only pictured it as one single textbox. I am intrigued by this "dual-tag" approach. I say we give it a shot. |
Any tag can be turned into the active input and the inputref is dynamically assigned to that input. So the "new tag" input isn't really that different from a "edit existing tag" input. Some whitespace and formatting changes as well. Stepped away from stashed changes for 8 days so this isn't the best commit msg.
Should just be whitespace changes due to linting.
…9/homebrewery into stringArrayEditor-update
made an error ~two commits ago, trying to tie newTagInput together with existing tag inputs. Keeping them separate....for now.
Discussed briefly in gitter: going to move forward with working on something like the below. Likely I will use a library like FloatingUI to handle the anchor positioning of menus (skipping CSS Anchor API for now since it is only available in Chrome and I don't want broken menus in firefox). Likely I will be working on improving the Combobox.jsx component first, possibly splitting out the "datalist" portion as it's own thing which is then imported to combobox, and add a few props. Styling isn't locked down at this point. |
@Gazook89 Is this PR paused for now? Wondering if I should move it out of my priority list if this needs to simmer some more. |
Pause it for now-- I just haven't been as plugged in to VSC over the summer as I've got other projects going on (both house stuff and other things). I wouldn't be bummed if someone branched off this and got it over the finish line, either (but I'll come back to it eventually too). |
This PR is going to close soon, in favor of a new branch. I would keep this PR, to keep the comments and such, if anyone confidently knew if it was possible to basically take my new branch and drop it in to replace the existing branch for this PR. But I'm not going to worry about that. The new branch will be a functional component, but otherwise will have all the same targets as this branch did (and hopefully be more clear). The add, remove, and edit functions on the new branch are working as of right now, but I haven't published it yet. I just want to give a heads up in case anyone has any last comments to throw here. |
We can close after referencing the branch, that should be enough. |
This is basically an implementation of what I wrote in #3466. It restructures the DOM of the StringArrayEditor and adds more functionality, such as better keyboard interaction. It removes what I consider "extra buttons" which I don't see used in many other tag editors/inputs. The styling is yet unfinished, but even at this stage is more inline with existing HB styling.
Keyboard
,
|Enter
input
)ArrowLeft
|ArrowRight
Enter
|Space
input
in tag or new-tag-inputEscape
Delete
Tab
|Shift + Tab
Things I want to hammer out:
Enter
or,
, the original text is reset and the tag isn't deleted.Delete
to delete characters after text cursor, the whole tag is deleted.Space
while editing an existing tag..invalid
styling when input field is empty, but still prevent entry of empty tagsmeta:
,systems:
, etc) using either upper or lowercase, but convert to lowercase when submitted.cleanValue()
method on stringArrayEditor is too specific to one instance of the component (brew tag editor), and has no application for other instances (like 'authors' input). Need to figure out how to pass that type of 'value manipulation' in as a prop? The crux is that the current 'validator' is lenient on the tag scheme case-- it can be entered lowercase or uppercase-- but we actually only accept lowercase here, andcleanValue()
was used to convert it to lowercase on submission. So maybe avalidator
prop and aacceptedValue
prop?Things I might want to do in this PR, but maybe not:
Things I might do if this PR is merged:
Related Issues:
ESC
out of it #3462Relevant PR:
#3469