react mobx jb selectbox input
npm install jb-selectbox-reactcustomizable drop-down menu can filter resualt by typing and support lazy load and loading
run npm install jb-selectbox-react to install package with npm
import component in your page import JBSelectBox from 'jb-selectbox-react'
you can import special edition for different envirement like es6 or requirejs or systemjs like: import JBSelectBox from 'jb-selectbox-react/dist/JBSelectBox.cjs.min' for requirejs version import JBSelectBox from 'jb-selectbox-react/dist/JBSelectBox.min' for standard es6 import JBSelectBox from 'jb-selectbox-react/dist/JBSelectBox.systemjs.min' for systemjs
use below syntax in your render function
as you can see in above example value is on-way binding like normal react forms input trueTitle is a title that place on true side of component and get bold on value == true onChange is standard too
the special thing about this component is onBeforeChange event that is optional but when defined you can show loading before before changing actual value and after your REST call or any othe async method you change actual value.
for example:
``javascript`
onBeforeChange(newValue){
return new Promise((resolve,reject)=>{
fetch(request).then((response)=>return response.json).then((data)=>{
resolve();
}).catch(()=>{reject()});
})
}
so when resolve called after REST call the onChange` prop will be called.
demo image:
