This repository was archived by the owner on Jan 11, 2023. It is now read-only.
Description It would be nice if simple values like strings and numbers that are smaller than 10 characters used the tooltip.
See the GIF below. 0 and " " have the popup when they'd look good in the tooltip.
Here is a small sample
diff --git a/src/components/Editor/Preview/Popup.js b/src/components/Editor/Preview/Popup.js
index 8c4057a..7cf0845 100644
--- a/src/components/Editor/Preview/Popup.js
+++ b/src/components/Editor/Preview/Popup.js
@@ -164,6 +164,15 @@ export class Popup extends Component {
return this.renderFunctionPreview(value, root);
}
+ // we can check here to see what we want to do...
+
+ const isSmallString = value.type == "string" && value.x.length < 10;
+ const isSmallNumber = value.type == "number" && value.x.toString().length < 10;
+
+ if (isSmallNumber || isSmallString) {
+ return this.renderSimplePreview(value);
+ }
+
if (value.type === "object") {
return (
<div>
Reactions are currently unavailable
It would be nice if simple values like strings and numbers that are smaller than 10 characters used the tooltip.
See the GIF below.
0and" "have the popup when they'd look good in the tooltip.Here is a small sample