Open heybran opened 1 year ago
pods-tooltip.js
file https://github.com/heybran/pods/commit/0a88aabc0f921ce859f963cca12a7f2950f13bbe , although codes format doesn't match with Wordpress coding styles, need to find a way to auto format this file.pods-tooltip.js
file, forgot about that.Replace old png
help icon (non-React ones) with a svg icon that was included in pods-tooltip
component
Added keyboard support for tooltip itself and any anchor inside, if any
pods-tooltip.js
on Line935 & 936 https://github.com/pods-framework/pods/blob/fb70bcc5f44a4003e297a1e49541f8bb439854a9/includes/general.php#L935 https://github.com/pods-framework/pods/blob/fb70bcc5f44a4003e297a1e49541f8bb439854a9/includes/general.php#L936 and render that custom element to the DOM on Line 972 https://github.com/pods-framework/pods/blob/fb70bcc5f44a4003e297a1e49541f8bb439854a9/includes/general.php#L972
Since pods_help()
is the function responsible for non-React
tooltip, and if this solution is accepted, does it mean we can clean up this pods_help()
, meaning removing those jQuery
related tooltip codes?Heya @sc0ttkclark
If you see this and have some time, I have a question.
I enqueue script of pods-tooltip.js
on Line935 & 936 https://github.com/pods-framework/pods/blob/fb70bcc5f44a4003e297a1e49541f8bb439854a9/includes/general.php#L935 https://github.com/pods-framework/pods/blob/fb70bcc5f44a4003e297a1e49541f8bb439854a9/includes/general.php#L936 and render that custom element to the DOM on Line 972 https://github.com/pods-framework/pods/blob/fb70bcc5f44a4003e297a1e49541f8bb439854a9/includes/general.php#L972
Since pods_help()
is the function responsible for non-React
tooltip, and if this solution is accepted, does it mean we can clean up this pods_help()
, meaning removing those jQuery
related tooltip codes?
After this, I get all I need to create a PR for this issue.
Yes, we'd need to update pods_help()
usage but also what we use in React would be at ui/js/dfv/src/components/help-tooltip.js
Whatever solution we go with here, we should ensure it is accessible and follows the necessary standards for screen readers as well.
Using one tooltip solution for both would be great. I'm not 100% sold on the <pods-tooltip>
custom HTML tag and how that affects accessibility.
Problem to Solve
Make non-React tooltip styles behave consistently. Maybe in future we can replace React tooltip as well to trim down dependencies?
Proposed Solution
As reported on #7118, there's few tooltips (non-React tooltip) that has style/accessibility issue, it would be nice to replace those tooltips with a standalone
pods-tooltip
custom element so tooltip styles can be encapsulated inside shadowRoot. Another cool thing about web components is that we can safely update styles without worrying it breaking other elements.I have coded out first version of
pods-tooltip
, it's looking pretty good so far?Still few improvements needed, hopefully I can get it done soon.