graylog-labs / graylog2-web-interface

[DEPRECATED]
https://www.graylog.org/
611 stars 174 forks source link

Boolean fields in create alarm callback dialog do not respect default values #1676

Closed lennartkoopmann closed 8 years ago

lennartkoopmann commented 8 years ago

When creating a new alarm callback, boolean configuration fields with a true default value are not pre-checked.

You can use the Slack alarm callback for testing. It has boolean fields with a true default value: https://github.com/Graylog2/graylog-plugin-slack/blob/ec158dcdff7c07f8bfbcb69c1f5fdc97bbf50b59/src/main/java/org/graylog2/alarmcallbacks/slack/SlackAlarmCallback.java#L134-L137

lennartkoopmann commented 8 years ago

Turns out this happens because Chrome tries to apply autofill. I think there is a HTML attribute to disable this on fields.

lennartkoopmann commented 8 years ago

I added it to the 1.3.0 milestone so it does not get lost.

kroepke commented 8 years ago

See http://www.w3.org/TR/html5/forms.html#autofilling-form-controls:-the-autocomplete-attribute

joschi commented 8 years ago

@kroepke It might not that simple unfortunately: https://stackoverflow.com/questions/15738259/disabling-chrome-autofill

edmundoa commented 8 years ago

I don't think this is related to form auto-completion, at least I found no way of reproducing it.

Playing a bit around I found an issue with the way we handle state on checkboxes in some forms (they all use the same React component). In those forms, changing any field unchecks checkboxes, which would explain the issue described here.

edmundoa commented 8 years ago

@lennartkoopmann could you take a look and see if #1693 fixes this issue for you?

bernd commented 8 years ago

Should be fixed with #1693. Please re-open if this is still an issue. Thank you!