Open roodie opened 5 years ago
Unfortunately, it’s not possible without doing a case by case modification of the widgets JS: the value itself is an ID, so we would have to somehow make it available in the <input />
.
We could decide to always use data-title
to store that value that would be used as a title when it’s available. It’s possible, but that would require an additional MutationObserver
I guess.
So doable, but requires changing a bit all the non-text JS files. Currently I’m struggling a bit to keep their changes up to date with the latest Wagtail changes. @gasman & I are currently working on gradually merging React StreamField changes into Wagtail instead of merging everything at once. As soon as we have finished merging the new styles (https://github.com/wagtail/wagtail/pull/5476), we will merge JS changes like the snippet JS changes, and finally react-streamfield itself. Once all merging is done, we can reconsider making that enhancement :)
Sure, I was able to do something similar using plain JS since my use case was rather specific (only on a specific page type and with a single specific field and stream block), but it is still a good enhancement I think.
I have a very simply structblock:
... but I have to display the name of the member as the title when the block is collasped. The problem is that the value for member at this stage is the id. Is there any hack, monkey patch, really, any solution to get the actual member.name field displayed as the title? I am completely stuck.