Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[Sheet Worker] Custom dropdown component with search behavior

So I have a custom dropdown component that uses the contents of an input box for it's search term. The trouble I'm having is that, in this case, the on('race:change,...) handler doesn't fire until the text input changed event triggers.  Is there any way to hook the input event so the search suggestions will update as I type?
1573547918
Andreas J.
Forum Champion
Sheet Author
Translator
Charles H. said: Is there any way to hook the input event so the search suggestions will update as I type? First of, wow, that's quite ambitious. I don't remember encountering this with any existing sheet. I think what you're attempting is outside the possibilities of the current character sheet framework, but someone who knows this better will likely have something to add. Maybe some advanced thing with faking the dropdown and using tons of CSS selectors could get close.
1573560517
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Unfortunately, the change events are actually on('blur') events. I ran into this same issue when I made an integrated compendium in the Starfinder hud sheet. Personally, I think making asuggestion for sheets to have access to actual change events would be good.
<a href="https://app.roll20.net/forum/post/7903294/" rel="nofollow">https://app.roll20.net/forum/post/7903294/</a>
1573578434

Edited 1573578535
GiGs
Pro
Sheet Author
API Scripter
I think you should expand on your suggestion, like explaining the situation at the start of the thread, and explain it in words not code. I think a lot of people who might otherwise vote for this suggestion aren't going to understand why its needed, as presented. I think people are going to look at that example and think they can do that with attributes or action buttons already. Sheet coding suggestions need support of people who aren't coders, if they are going to get a decent number of votes.
That's a good idea.&nbsp; I added an animated example for what is currently not possible with teh current setup.&nbsp; If you have any other wording suggestions, please let me know.&nbsp; I don't know the average user's level of technical aptitude, so I don't know how "dumbed down" to make it.
1573585742
GiGs
Pro
Sheet Author
API Scripter
I think that gif helps a lot.
1573645522
Andreas J.
Forum Champion
Sheet Author
Translator
GiGs said: I think you should expand on your suggestion, like explaining the situation at the start of the thread, and explain it in words not code. I think a lot of people who might otherwise vote for this suggestion aren't going to understand why its needed, as presented. I think people are going to look at that example and think they can do that with attributes or action buttons already. Sheet coding suggestions need support of people who aren't coders, if they are going to get a decent number of votes. Yeah the example at least gave me a hint of the possible application for it(not that I understand how). I still don't grasps what difference it makes, beside maybe reducing number of attributes needed for advanced character sheet stuff, but gave it a upvote anyway. If it gives us tons of new things we can do, then I'm all for it. Charles H. said: That's a good idea.&nbsp; I added an animated example for what is currently not possible with teh current setup.&nbsp; If you have any other wording suggestions, please let me know.&nbsp; I don't know the average user's level of technical aptitude, so I don't know how "dumbed down" to make it. So I'd say you're overestimating the average user a fair bit, considering just a couple of dozen people here know HTML/CSS/JS to the extent that they know how to use them for character sheet creation, and I'm on the low end of that bunch.
1573654250
Kraynic
Pro
Sheet Author
Andreas J. said: Charles H. said: That's a good idea.&nbsp; I added an animated example for what is currently not possible with teh current setup.&nbsp; If you have any other wording suggestions, please let me know.&nbsp; I don't know the average user's level of technical aptitude, so I don't know how "dumbed down" to make it. So I'd say you're overestimating the average user a fair bit, considering just a couple of dozen people here know HTML/CSS/JS to the extent that they know how to use them for character sheet creation, and I'm on the low end of that bunch. And some of us that do, barely qualify on the "know" part of that statement.&nbsp; Just speaking as someone that posted an example bit of code in a question thread once, and had more knowledgeable people point out a problem and tell me they didn't know why my sheet worked as written...
1573656628
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Kraynic said: And some of us that do, barely qualify on the "know" part of that statement.&nbsp; Just speaking as someone that posted an example bit of code in a question thread once, and had more knowledgeable people point out a problem and tell me they didn't know why my sheet worked as written... Heh, I think we've all been there
I've reached out to a friend to help me convert this into layman.&nbsp; For tech professionals, it can be hard to hit that sweet spot in between "Still to complex for a non-technical audience" and "condescendingly speaking to them like they're discovering fire for the first time."