Skip to content

Commit 0f67cd0

Browse files
authored
feat: Add focus_on_load support for remaining block elements (#1519)
This adds `focus_on_load` to the remaining Slack BlockKit Block Elements that support it: * `{static,external,users,conversations,channels}_select` * `multi_{static,external,users,conversations,channels}_select` * `datepicker` * `timepicker` * `plain_text_input` * `checkboxes` * `radio_buttons` * `number_input` Closes: #1518
2 parents efd43a0 + 825d69b commit 0f67cd0

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

block_element.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ type SelectBlockElement struct {
248248
Filter *SelectBlockElementFilter `json:"filter,omitempty"`
249249
MinQueryLength *int `json:"min_query_length,omitempty"`
250250
Confirm *ConfirmationBlockObject `json:"confirm,omitempty"`
251+
FocusOnLoad bool `json:"focus_on_load,omitempty"`
251252
}
252253

253254
// SelectBlockElementFilter allows to filter select element conversation options by type.
@@ -339,6 +340,7 @@ type MultiSelectBlockElement struct {
339340
MinQueryLength *int `json:"min_query_length,omitempty"`
340341
MaxSelectedItems *int `json:"max_selected_items,omitempty"`
341342
Confirm *ConfirmationBlockObject `json:"confirm,omitempty"`
343+
FocusOnLoad bool `json:"focus_on_load,omitempty"`
342344
}
343345

344346
// ElementType returns the type of the Element
@@ -459,6 +461,7 @@ type DatePickerBlockElement struct {
459461
Placeholder *TextBlockObject `json:"placeholder,omitempty"`
460462
InitialDate string `json:"initial_date,omitempty"`
461463
Confirm *ConfirmationBlockObject `json:"confirm,omitempty"`
464+
FocusOnLoad bool `json:"focus_on_load,omitempty"`
462465
}
463466

464467
// ElementType returns the type of the Element
@@ -486,6 +489,7 @@ type TimePickerBlockElement struct {
486489
InitialTime string `json:"initial_time,omitempty"`
487490
Confirm *ConfirmationBlockObject `json:"confirm,omitempty"`
488491
Timezone string `json:"timezone,omitempty"`
492+
FocusOnLoad bool `json:"focus_on_load,omitempty"`
489493
}
490494

491495
// ElementType returns the type of the Element
@@ -597,6 +601,7 @@ type PlainTextInputBlockElement struct {
597601
MinLength int `json:"min_length,omitempty"`
598602
MaxLength int `json:"max_length,omitempty"`
599603
DispatchActionConfig *DispatchActionConfig `json:"dispatch_action_config,omitempty"`
604+
FocusOnLoad bool `json:"focus_on_load,omitempty"`
600605
}
601606

602607
type DispatchActionConfig struct {
@@ -684,6 +689,7 @@ type CheckboxGroupsBlockElement struct {
684689
Options []*OptionBlockObject `json:"options"`
685690
InitialOptions []*OptionBlockObject `json:"initial_options,omitempty"`
686691
Confirm *ConfirmationBlockObject `json:"confirm,omitempty"`
692+
FocusOnLoad bool `json:"focus_on_load,omitempty"`
687693
}
688694

689695
// ElementType returns the type of the Element
@@ -710,6 +716,7 @@ type RadioButtonsBlockElement struct {
710716
Options []*OptionBlockObject `json:"options"`
711717
InitialOption *OptionBlockObject `json:"initial_option,omitempty"`
712718
Confirm *ConfirmationBlockObject `json:"confirm,omitempty"`
719+
FocusOnLoad bool `json:"focus_on_load,omitempty"`
713720
}
714721

715722
// ElementType returns the type of the Element
@@ -740,6 +747,7 @@ type NumberInputBlockElement struct {
740747
MinValue string `json:"min_value,omitempty"`
741748
MaxValue string `json:"max_value,omitempty"`
742749
DispatchActionConfig *DispatchActionConfig `json:"dispatch_action_config,omitempty"`
750+
FocusOnLoad bool `json:"focus_on_load,omitempty"`
743751
}
744752

745753
// ElementType returns the type of the Element

0 commit comments

Comments
 (0)