Comments (6)
@ivaneliasoo I just fixed it for next release: #6546
from primereact.
In the code, buttons manually controlling the navigation between steps using the nextCallback
and prevCallback
methods. These methods do not trigger the onChange
event.
If you want to execute some code when the step changes, you could do this within the onClick
handlers of your "Next" and "Back" buttons.
<Button label="Next" icon="pi pi-arrow-right" iconPos="right" onClick={() => { stepperRef.current.nextCallback(); console.log('Step changed to: ' + (stepperRef.current.state.activeIndex + 1)); }} />
from primereact.
I'm referencing this part of the stepper api documentation:
from primereact.
In the code, buttons manually controlling the navigation between steps using the
nextCallback
andprevCallback
methods. These methods do not trigger theonChange
event.If you want to execute some code when the step changes, you could do this within the
onClick
handlers of your "Next" and "Back" buttons.
<Button label="Next" icon="pi pi-arrow-right" iconPos="right" onClick={() => { stepperRef.current.nextCallback(); console.log('Step changed to: ' + (stepperRef.current.state.activeIndex + 1)); }} />
also, I'm unable to access state through the ref, the only available functions it reveals are next previous and get element
from primereact.
Submitted a PR to add getActiveStep()
and setActiveStep(step)
to the ref
.
from primereact.
Hi, I'm facing this issue too, and I believe that problem is the event name so it must be wrong in documentation ("onChange") or in code ("onChangeStep") , so using "onChangeStep" works correctly but with type errors
but no event info is returned, only index info
from primereact.
Related Issues (20)
- Dropdown: Simple primitive values showing empty items HOT 1
- DataTable: Column Reorder Indicator Incorrect
- Calendar: Prop typings are not working correctly HOT 5
- InputNumber: number formatting does not update when locale is set through PrimeReactContext HOT 1
- IconField: Reference error React is not defined, im using vite HOT 4
- Dropdown: Init-Value not working if options have label,value properties HOT 8
- DataTable: Reordering Columns Causes Duplication in Checkbox Column and Reorder Row Indicator Column HOT 1
- Dropdown: No longer shows options with simple primitive values HOT 1
- InputOtp: Setting Value does not clear display
- Password > Icon and Input render order > tabIndex issue HOT 1
- Typo error on the Theming page HOT 1
- DataTable: re-order + resizable fails HOT 2
- Typo error on `PrimeFlex` section of the Theming documentation HOT 1
- Readme typo HOT 1
- Sidebar: Headless Sidebar is hidden in Small and Medium-Sized Views HOT 1
- PanelMenu MenuItem Id Prop Not Passed
- DataTable: Row groups are duplicated when the groupRowsBy value is changed
- onSort return only one value on every event HOT 2
- MeterGroup: Percentages always based on max 100 HOT 3
- DataTable Dropdown Filter: Value is not getting updated upon selection HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from primereact.