Add support for disabling inputs based on a pref to config-based settings
Categories
(Firefox :: Settings UI, enhancement)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox143 | --- | fixed |
People
(Reporter: hjones, Assigned: mkennedy)
References
(Blocks 1 open bug)
Details
(Whiteboard: [recomp])
Attachments
(1 file)
We need to introduce a way to disable and reenable inputs based on pref values to config-based settings.
The browserRestoreSession checkbox is disabled depending on the value of the browser.privatebrowsing.autostart pref, so could be a good candidate for replacement as part of the work on this feature.
Here's a preference configuration that could work for this case:
Preferences.addSetting({
id: "browserRestoreSession",
pref: "browser.startup.page",
// add a function with the logic for whether or not the input should be disabled
disabled: () => {
// TODO: disabled logic goes here
},
...
});
We'll then need to add logic to the Setting class to add a disabled getter that calls the disabled function and returns false by default (I imagine this will look pretty similar to the visible getter). There will be some additional work in the settings-control and settings-group elements to ensure disabled gets set on input elements.
Acceptance criteria:
- it's possible to
disablean input based on some preferences configuration - add tests to cover this
Updated•1 year ago
|
Comment 1•11 months ago
|
||
I think this should be done after bug 1966542. Related settings will likely be useful here and we should consider how we can easily pass those to the disabled function to check if it should be disabled
Preferences.addSetting({
id: "browserRestoreSession",
pref: "browser.startup.page",
deps: ["permanentPrivateBrowsing"],
// add a function with the logic for whether or not the input should be disabled
// deps comes from bug 1966542, the API will be defined in that ticket
disabled: deps => deps.permanentPrivateBrowsing.value,
...
});
| Assignee | ||
Updated•10 months ago
|
| Assignee | ||
Comment 2•10 months ago
|
||
Depends on https://phabricator.services.mozilla.com/D257555 and I'm still
adding tests, but just wanted to open this up for early review.
Comment 4•9 months ago
|
||
| bugherder | ||
Updated•9 months ago
|
Description
•