Bug in events of custom components #1187
Unanswered
williamneto
asked this question in
Problem
Replies: 2 comments 1 reply
-
I have confirmed this issue exists using the following {
"main": "src/index.js",
"type": "module",
"scripts": {
"build": "rollup --config"
},
"devDependencies": {
"@babel/preset-env": "^7.23.6",
"@babel/preset-react": "^7.23.3",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^24.0.1",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-replace": "^5.0.2",
"@types/react": "^17.0",
"@types/react-dom": "^17.0",
"prettier": "^3.0.2",
"rollup": "^3.28.1",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-exclude-dependencies-from-bundle": "^1.1.23",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-replace": "^2.2.0",
"typescript": "^4.9.5"
},
"dependencies": {
"htm": "^3.1.1",
"react": ">=16 <18",
"react-dom": ">=16 <18",
"rollup": "^4.9.5"
}
} and the following import nodeResolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import babel from "@rollup/plugin-babel";
import replace from "@rollup/plugin-replace";
export default {
input: "src/index.js",
output: {
file: "bundle.js",
format: "esm",
},
plugins: [
nodeResolve({
extensions: [".js", ".jsx"],
}),
babel({
babelHelpers: "bundled",
presets: ["@babel/preset-react"],
extensions: [".js", ".jsx"],
}),
commonjs(),
replace({
preventAssignment: false,
"process.env.NODE_ENV": '"development"',
}),
],
onwarn: function (warning) {
if (warning.code === "THIS_IS_UNDEFINED") {
// skip warning where `this` is undefined at the top level of a module
return;
}
console.warn(warning.message);
},
}; |
Beta Was this translation helpful? Give feedback.
1 reply
-
I'm wrapping the mantine libs for reactpy and also have this problem, which makes the input extremly frustrated. for me, I've tested 3 cases
right now , I have to stay away from binding state to the js input component, but add a button to capture the value from the input T^T... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So, while developing reactpy-material i faced a problem that might be related to the reactpy architecture for custom components.
To showcase the problem i created this small component, just a normal textfield. The problem is when attaching a on_change event to this custom component, the event on the page doesn't behavior as expected. Each time you type in the field (and trigger the onChange event) the page focus is moved out of the input element.
So, a simple custom TextField like that
And when you try to use it like that
You end up with this weird behavior at the page focus, making type in this field very unpratical
Beta Was this translation helpful? Give feedback.
All reactions