Skip to content
This repository was archived by the owner on Nov 19, 2022. It is now read-only.

Conversation

hamed-sb
Copy link
Contributor

Add
+AutoComplete component
+useAutoComplete hooks function
+StylesProvider componen for support jss
+some missing props

edit StyleBiulder for support static style

Copy link
Owner

@subroh0508 subroh0508 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late review!

I tried to check the operation, but I got an error with the following code 😭 If it works in your local environment, I would like to see the sample code.

val data: Array<Data> = arrayOf(
    jsObject { name = "Mizuki Makabe"; age = 17 },
    jsObject { name = "Madoka Higuchi"; age = 17 },
)

autoComplete<Data> {
    attrs.options = data
    attrs.getOptionLabel = { it.name }
    attrs.renderInput = {
        buildElements {
            textField {
                console.log(Object.assign(attrs, it))
                Object.assign(attrs, it)
                attrs.label { +"Combo box" }
                attrs.variant = FormControlVariant.outlined
            }
        }
    }
}

Clicking on it will result in an error like this.

Uncaught TypeError: Cannot read property 'focus' of null
    at handleClick (webpack-internal:///../../node_modules/@material-ui/lab/esm/useAutocomplete/useAutocomplete.js:928)
    at HTMLUnknownElement.callCallback (webpack-internal:///../../node_modules/react-dom/cjs/react-dom.development.js:188)
    at Object.invokeGuardedCallbackDev (webpack-internal:///../../node_modules/react-dom/cjs/react-dom.development.js:237)
    at invokeGuardedCallback (webpack-internal:///../../node_modules/react-dom/cjs/react-dom.development.js:292)
    at invokeGuardedCallbackAndCatchFirstError (webpack-internal:///../../node_modules/react-dom/cjs/react-dom.development.js:306)
    at executeDispatch (webpack-internal:///../../node_modules/react-dom/cjs/react-dom.development.js:389)
    at executeDispatchesInOrder (webpack-internal:///../../node_modules/react-dom/cjs/react-dom.development.js:411)
    at executeDispatchesAndRelease (webpack-internal:///../../node_modules/react-dom/cjs/react-dom.development.js:3278)
    at executeDispatchesAndReleaseTopLevel (webpack-internal:///../../node_modules/react-dom/cjs/react-dom.development.js:3287)
    at forEachAccumulated (webpack-internal:///../../node_modules/react-dom/cjs/react-dom.development.js:3259)

@hamed-sb
Copy link
Contributor Author

hamed-sb commented Dec 25, 2020

you must use props() method for set props
like this props( it as TextFieldProps)

sorry my English is not good
thanks for review

Comment on lines +38 to +41
val DATA: Array<Person> = arrayOf(
jsObject { name = "Mizuki Makabe"; age = 17 },
jsObject { name = "Madoka Higuchi"; age = 17 },
)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 👍 👍

Copy link
Owner

@subroh0508 subroh0508 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's very good! I'm sorry I left it for two months 😭
madoka

@subroh0508 subroh0508 merged commit 55c820f into subroh0508:master Feb 21, 2021
subroh0508 added a commit that referenced this pull request Sep 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants