Skip to content
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

Bug: 'Copy' checkbox not active by default for all fields #1473

Open
mdsimpson42 opened this issue Oct 18, 2023 · 8 comments
Open

Bug: 'Copy' checkbox not active by default for all fields #1473

mdsimpson42 opened this issue Oct 18, 2023 · 8 comments
Assignees

Comments

@mdsimpson42
Copy link
Contributor

mdsimpson42 commented Oct 18, 2023

On some fields, such as those under "Energy Performance -> Retrofit history", the Copy [/] buttons appear, but are not checked by default, like they are on other fields. I had a quick look into this, but couldn't work out what was causing it.

@mdsimpson42
Copy link
Contributor Author

I'm struggling to get my head around how the Copy system works. I've been digging through the code for ages and I still get work out how it chooses which fields to copy, let alone why some fields don't have the copy checkbox ticked by default. I'll come back to this.

@polly64
Copy link
Contributor

polly64 commented Oct 24, 2023

@matkoniecz any possible thoughts on this one if you're free?

@polly64
Copy link
Contributor

polly64 commented Jan 11, 2024

this is a slightly different one because it's copying verification not attributes

@mdsimpson42
Copy link
Contributor Author

From another issue: "Architectural style needs autofill for all copy boxes like others" (from colouring-cities#165)
This is another example of fields that aren't set up correctly, the coy boxes aren't being autofilled.

@polly64
Copy link
Contributor

polly64 commented Apr 10, 2024

@matkoniecz maybe you could look at this when you have time?

@mdsimpson42 mdsimpson42 transferred this issue from colouring-cities/colouring-britain Dec 5, 2024
@mdsimpson42
Copy link
Contributor Author

Connected to #1471? Close duplicate or merge?

@matkoniecz matkoniecz changed the title Bug: 'Copy' checkbox not active for all fields Bug: 'Copy' checkbox not active for all fields by default Dec 12, 2024
@matkoniecz matkoniecz changed the title Bug: 'Copy' checkbox not active for all fields by default Bug: 'Copy' checkbox not active by default for all fields Dec 12, 2024
@matkoniecz
Copy link
Contributor

BTW, I see

Warning: A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components
input
label
div
div
DataTitleCopyable@http://localhost:3001/static/js/client.js:92911:85
NumericDataEntry@http://localhost:3001/static/js/client.js:93280:30
div
DataEntryGroup@http://localhost:3001/static/js/client.js:92790:70
AgeHistoryView@http://localhost:3001/static/js/client.js:94004:22
form
div
section
DataContainer@http://localhost:3001/static/js/client.js:93689:13
BuildingView@http://localhost:3001/static/js/client.js:92620:76
Route@http://localhost:3001/static/js/client.js:79427:29
Switch@http://localhost:3001/static/js/client.js:79629:29
Route@http://localhost:3001/static/js/client.js:79427:29
Switch@http://localhost:3001/static/js/client.js:79629:29
div
div
Sidebar@http://localhost:3001/static/js/client.js:96299:86
MapApp@http://localhost:3001/static/js/client.js:100650:77
Route@http://localhost:3001/static/js/client.js:79427:29
Switch@http://localhost:3001/static/js/client.js:79629:29
AuthProvider@http://localhost:3001/static/js/client.js:92425:22
DisplayPreferencesProvider@http://localhost:3001/static/js/client.js:99956:36
App@http://localhost:3001/static/js/client.js:92369:117
Router@http://localhost:3001/static/js/client.js:79058:30
BrowserRouter@http://localhost:3001/static/js/client.js:77736:35

and

Warning: A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components

in browser logs on using copy checkboxes.

It seems that broken checkboxes start as undefined, while marked by default start as true

@mdsimpson42
Copy link
Contributor Author

I've looked in the code, and I still can't find any difference between (for example) "location_address_source" (which defaults to checked) and "location_subdivisions_source_type" (which doesn't). The code is the same, they're using the same props.copy value...

Unless the copy value is defined somewhere else in the code and I missed a step when I was adding these new properties to the code...? But I've been digging around and I can't find anywhere that lists the fields that are allowed to be copied or anything like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants