-
Notifications
You must be signed in to change notification settings - Fork 18
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
inputElement Improvement Suggestion #7
Comments
Hello, Good issue. This will be great ! Thanks ! Oxyno-zeta |
@Hawkpath After a small research, this can be done on the edit mode. The problem is on the add mode. Datatype will be 'undefined'. I won't implement it today. I must think more about this point. If you have an idea, don't hesitate ;-) Oxyno-zeta |
Thanks for looking into this! So, the problem you're thinking about is that when you are adding a new item with the + button, there is no Perhaps you could add a new property, such as |
I see the possibilty you exposed. In fact, this can be really great. Another problem in on the textareaElement :). A possibility can be:
@Hawkpath : Do you see something wrong ? (Sorry for this late explanation, it is late here and hard day...) |
Don't worry about the delay! It took me a week or two of thinking about this idea before I even submitted an issue for it, so there are no problems here. :P I appreciate you working with me on this. I actually didn't mention textarea because I've never used it! I looked through your source code yesterday to find what it does, and from what I can see, it's just used to edit functions, right? I didn't think anyone would ever need to conditionally display a different textarea, but I suppose there's no reason to not do for textareaElement what is done for inputElement since it's so similar and users would expect for it to work the same way.
I just remembered while writing the paragraph above that Another thing I have a question about is how you retrieve the edited value when the user clicks the edit button element. I see you use ref.value, which is directly accessing the HTML DOM element, but I was wondering if it's possible to edit this value so that a custom component passed as the |
@Hawkpath :
A possibility can be:
So you are in the add case when dataType is For your second question, I've edited the example you give me. See https://pastebin.com/YpmfKMwt For this issue and your question, I was thinking of providing a way to give the parse function you want to execute (used on onClick event for add/edit). For the moment, it is only mine but you may want to change it. So, it seems that we are ok. I will try to implement it today. Don't hesitate to answer ! :) |
Hello @Hawkpath, I've just released the 2.2.0 with new features. Oxyno-zeta PS: Thanks for the idea :) |
I'm glad we figured it all out. The morning coffee is the true hero here! Haha :D Also, thanks for the help with the other problem I mentioned. I'll be sure to make a separate issue next time instead of adding on to an existing one :P. I hadn't read about Javascript's getter/setter syntax yet, so I'm glad I've learned it now. |
@Hawkpath No problem for the second part. The getter/setter syntax comes with class. Just have a read of get/set in JavaScript class. You will understand quickly ;-). Also thanks to you for using, improving and following issues ! |
Hello again! I've gotten an idea for an improvement to your library.
Currently, you have the
inputElement
prop which is used to globally define the element used to edit values. I really like how you've implementedgetStyle
andreadOnly
, and I thought it would be useful to have similar functionality forinputElement
-- pass it as a function which receives the parameterskeyName, data, keyPath, deep, dataType
and returns an input element. It probably wouldn't be difficult to maintain backward compatibility like this, either.The reason I think this change would be helpful is that you can have special handlers for specific types of data (such as numbers, dates, and times). Personally, I would like this so that I could display toggle buttons to change boolean values by clicking instead of having to type "true"/"false".
I'd like to hear what you think about this!
The text was updated successfully, but these errors were encountered: