laravel / nova-issues

554 stars 34 forks source link

Field with readonly and default field not saving #3757

Closed nikans closed 2 years ago

nikans commented 2 years ago

So there was a straight answer to that https://github.com/laravel/nova-issues/issues/3630, but I would like for you to reconsider: there're cases when you need to display a field as readonly on create (i.e. preset BelongsTo). Since there aren't any real problems with just passing the immutable value around, I can't see why not.

Also, I know you have a lot of work, but more and more, browsing this repository issues (and I have to do that a lot), I'm getting the feeling that you just don't care. It's probably not true, but it sure looks like that. Nova is a paid software (even if it's cheap) and the responders' attitude is just plain arrogant 90% time. FYI.

davidhemphill commented 2 years ago

Duplicate of #3630

Happy to consider alternate use-cases. In this case, it's the expected behavior for the field because HTML inputs specified as readonly don't send their values when a form POSTs. Also, it would be a breaking change and would have to wait until the next series. That particular issue should be marked as a request.

If you could be more specific as to what things bring you to this repository as "supplemental documentation", that would be helpful. We've recently done a rework of our documentation in preparation for the new series but would value any further input.

We care about Nova. Email support is handled every day. This non-official issues support forum gets worked every day and is frankly, a lot of the time, wasted and thankless work. The software gets consistent updates throughout the year. I don't think that's a fair statement, but you're entitled to your opinion.

Also, please consider that our team is multi-lingual, with the main person handling responses not being a native English speaker. Occam's Razor might apply here, and some things can be lost in translation.

nikans commented 2 years ago

That particular issue should be marked as a request.

Oh, I was sure I clicked "Feature request" button, sorry.

Thank you for the explanation.

I love your work, it's just Nova team sound overwhelmed or something most of the time. English is not my first language, too, but curt answers "This is as it supposed to be — closing ticket" are getting on your nerves eventually, especially when there's a 30-messages thread after the ticket is closed...

UPD @davidhemphill: I definitely seen the template for feature request when created this issue, the autoclosing feature is probably broken or something.

nikans commented 2 years ago

@davidhemphill also about the thanklessness of the job: I really understand that supporting takes a lot of time you could have spent developing new features for us. But since the docs cover only the basics, when you are neck deep in the development process using Nova, you google a lot. And thankfully this repository pops up every time, and most of the times it's really helpful. So please consider this.

chimit commented 2 years ago

HTML inputs specified as readonly don't send their values when a form POSTs

@davidhemphill I don't think it's true. Probably, you are talking about disabled because readonly attribute still sends values in POSTs. Don't you think it would be a good idea to have two separate methods readonly and disabled for better control? It's currently not possible even via tricks like:

->withMeta([
    'extraAttributes' => [
        'readonly' => true,
        'disabled' => false,
    ],
])

https://github.com/laravel/nova-issues/issues/4649

marlocorridor commented 1 year ago

It's currently not possible even via tricks like:

->withMeta([
    'extraAttributes' => [
        'readonly' => true,
        'disabled' => false,
    ],
])

As of v4.22.1, This "trick" still does not work.

Workarounds we employ are:

chimit commented 1 year ago

@davidhemphill @crynobone can it be reopened or turned into a discussion since it's a valid proposal to support both attributes disabled and readonly as they both are supported HTML attributes?

https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly#attribute_interactions

A common use case for readonly is, for example, when we have a field that should have a default value (e.g. not nullable in the DB) but shouldn't be editable by the user. It is usually needed when you have dependent fields and you want to disable some fields dynamically.

msucevan commented 3 months ago

@crynobone this is a bug, this cannot be the expected behaviour.