Closed (fixed)
Project:
Client-side Hierarchical Select
Version:
8.x-3.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 Jan 2022 at 14:27 UTC
Updated:
26 Apr 2022 at 18:03 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #4
marco.aresu commentedI have the same problem. The solution proposed in the fork cshs-3258226, solve the problem.
Comment #5
marco.aresu commentedI attach the patch from the fork cshs-3258226
Comment #6
collinhaines commentedRunning into the same issue on Chrome, Firefox, and Edge. #5 resolved this for me.
Comment #7
chrisckSame issue on Chrome and Edge. Applying #5 patch to 3.x-dev has fixed the issue for me. Not sure when the problem started occuring, however it's likely due to a recent browser update.
Comment #8
bernardm28 commentedWe ran into the same issue with Chrome and Edge.
Comment #9
rutiolma+1
Comment #10
br0kenThat's really weird. For some reason, it works for me with the
innerTextand always was.Can someone elaborate, was it worked before and suddenly stopped or have never worked before?
Comment #11
rutiolma@BR0kEN I noticed this suddenly when clients started to report it, so maybe it was a browser change?
In my case there's only a problem when the field starts hidden (I use cshs along with menu_link_weight and, when adding a new node I get this problem because the menu select list starts hidden). And it seems normal to have an issue in this case when using
innerTextbecause it will get the element text as presented to the user. If the field starts hidden, there's no text presented and that's why innerText has empty values.The provided patch would also work with
textContentwhich gets the raw textual content inside an element, even if its not visible for the user.Comment #12
joshua1234511Could replicate the issue after update to latest release.
"drupal/cshs": "^3.5"
Issue is replicable on Latest Chrome.
Attached screenshot of Before and After.
Patch provided https://www.drupal.org/project/cshs/issues/3258226#comment-14365871 works for me.
Comment #13
br0kenYeah, that's according to the spec https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent.
I wonder why I'm not seeing this behavior in any browser on macOS and iOS.
Given the above code, both
textandinnerTextare the same.Anyway, I tend to commit the patch.
Comment #16
br0kenComment #17
br0kenCommitted to 8.x-3.x. Thanks.
Comment #18
chrisckJust wanted to say thanks for the quick fix and commit :)
Comment #19
johnzzonRan into this as well after latest Chrome update. Thanks for the patch!
Comment #20
ipwa commentedComment #22
willeaton commentedCan this get pushed into a release so I don't have to use the dev version in prod please?
Something weird happened for me, on installing the stable version and configuring the field for the first time it worked perfectly, I could see the labels, then all of a sudden they disappeared. Very weird!
One thing I did notice is that upon trying to debug the JS, chrome doesn't use the jquery file supplied by drupal, it instead uses this file:
webpack://cshs/src/jquery.simpler-select.ts.
I confirm the dev version has this fixed but as stated above, would like to avoid having this in prod.
Thanks in advance!
Comment #23
br0kenI'll do a release in a moment.
This called source maps. They allow to map JS code to the actual source it's transpiled from, which is TS. Very handy for debugging in IDE and DevTools.
https://www.drupal.org/project/cshs/releases/8.x-3.6