primefaces / primereact

The Most Complete React UI Component Library
https://primereact.org
MIT License
6.91k stars 1.05k forks source link

Feature Request: More events for Inplace elements (onClose, onSubmit, onInit) #1547

Closed michaelslec closed 4 years ago

michaelslec commented 4 years ago

There is no guarantee in receiving an immediate response in GitHub Issue Tracker, If you'd like to secure our response, you may consider PrimeReact PRO Support where support is provided within 4 business hours

I'm submitting a ... (check one with "x")

[ ] bug report
[x] feature request
[ ] support request => Please do not submit support request here, instead see https://forum.primefaces.org/viewforum.php?f=57

Codesandbox Case (Bug Reports) Please fork the codesandbox below and create a case demonstrating your bug report. Issues without a codesandbox have much less possibility to be reviewed.

https://codesandbox.io/s/qjx332qq4

Current behavior Inplace elements only have onClose, onOpen, and onToggle events

Expected behavior

It would be super helpful to have onCancel, onSubmit, onInit type events, just like editable cells in the DataTable. This would allow for expandable rows with more form data to have as advanced state management as the rows themselves.

Minimal reproduction of the problem with instructions

Please tell us about your environment:

Arch Linux VSCode Insiders NPM CRA

mertsincan commented 4 years ago

Hi,

These events do similar things. DataTable - Inplace onCancel -> onClose onInit -> onOpen onSubmit -> you can add it to form element

Please see;

...
   open(event) {
        if (this.props.disabled) {
            return;
        }

        if (this.props.onOpen) { // The onOpen event is invoked before the content is displayed.
            this.props.onOpen(event);
        }

        if (this.props.onToggle) {
            this.props.onToggle({
                originalEvent: event,
                value: true
            });
        }
        else {
            this.setState({
                active: true
            });
        }
    }
...

Best regards,