edit-in-place icon indicating copy to clipboard operation
edit-in-place copied to clipboard

Add EditableGroupDirective to public API

Open jordanmaslyn opened this issue 3 years ago • 3 comments

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[ x] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

There is no means (that I can tell) to track an outside click to disable the editing for a group, and doing so should be relatively straight forward if the directive was exposed for use in another custom directive.

Expected behavior

I would love to be able to somehow change modes for a group when an outside click is detected.

I can think of a couple of ways to accomplish this. One is just writing my own directive to handle it, but because this lib does not export the EditableGroupDirective, I have no means to inject it into my own directive to make changes. Could the change be made to export the directive?

Minimal reproduction of the problem with instructions

Create a table where the <tr> is both editableGroup and editableGroupEdit. Clicking on the <tr> turns on editing for the row but if I want to capture a click anywhere else in the document, I have no way of doing that.

What is the motivation / use case for changing the behavior?

Turning off edit mode in one fell swoop without a dedicated button.

jordanmaslyn avatar Mar 17 '21 18:03 jordanmaslyn

+1

RadouaneRoufid avatar Apr 28 '21 00:04 RadouaneRoufid

You're welcome to submit a PR.

NetanelBasal avatar Apr 28 '21 05:04 NetanelBasal

Hello @jordanmaslyn,

I'm really sorry : by the time you opened this issue i prepared an answer to let you know i would be busy for the next two months and wouldn't be able to provide a PR myself. I realised today i didn't submitted my answer :( As these two months have passed, i'll be able to work on it next week.

Rather than exporting the directive, i'll make some expriment to use the same behavior added into the editable component to detect clicks outside of the element. It should make it more simple to use.

geromegrignon avatar May 13 '21 16:05 geromegrignon