Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

fixed: a readonly select-minimal with an itemset is functional but sh… #139

Merged
merged 1 commit into from
Jan 19, 2022

Conversation

MartijnR
Copy link
Member

@MartijnR MartijnR commented Nov 30, 2021

…ould be disabled (readonly), closes enketo/enketo-core#138

Partial fix for enketo/enketo#87 (the remainder of the fix is in enketo-core enketo/enketo-core#843)

@eyelidlessness
Copy link
Contributor

I'm running enketo/enketo-core#843 to validate this. A couple observations:

  1. It's difficult to compare before/after behavior when using github: URLs in package.json. Rolling back to 2.1.1 so I could compare the behavior didn't actually roll back to 2.1.1, because the version was already satisfied with the dependency installed from GitHub. I had almost thought that this change wasn't affecting transformation at all, until I realized I needed to remove the installed version and rerun npm install.

    No need to change anything here, but in the future we might make this process easier/less error prone if we temporarily (or optimistically?) change the version in enketo-transformer (and similarly in enketo-core when a change needs to be evaluated in enketo-express).

  2. Notwithstanding point 1, I see identical behavior in enketo-core with 2.1.1 installed. I do see the difference in transformer output in the network tab, but the changes in Disable <option>s for readonly <select>s with itemsets enketo-core#843 alone appear to fix the issue as reported. Is this change necessary?

@MartijnR
Copy link
Member Author

MartijnR commented Dec 13, 2021

Thanks!

  1. Yes, indeed. Tbh I almost always remove node_modules to avoid issues. Do you mean changing the version e.g. with some alpha, or github issue number suffix? Yes, if that solves it that sounds fine to me!
  2. Indeed, it almost fixes it. The only difference is that the empty value remains operational (in a select minimal), so you can clear an existing value (or appear to be able to) when you shouldn't be allowed to.

Copy link
Contributor

@eyelidlessness eyelidlessness left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, indeed. Tbh I almost always remove node_modules to avoid issues. Do you mean changing the version e.g. with some alpha, or github issue number suffix? Yes, if that solves it that sounds fine to me!

Yep. I think we can use something like this and it would probably do the trick!

Indeed, it almost fixes it. The only difference is that the empty value remains operational (in a select minimal), so you can clear an existing value (or appear to be able to) when you shouldn't be allowed to.

Yeah I noticed that subtle difference after posting my comment. I think I had misunderstood the intent: I thought the idea was that the field should prevent selection and not have a value, but I understand now that the idea is to make the value read-only, which makes sense.

@eyelidlessness eyelidlessness merged commit 5483fd9 into master Jan 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants