Skip to content

Commit

Permalink
chore: rename defaultInputCompatFallthrough → defaultCompatFallthrough
Browse files Browse the repository at this point in the history
- Renames `defaultInputCompatFallthrough` to `defaultCompatFallthrough`
  because there are many other components affected by the same Vue 3
  change in attribute fallthrough behavior. I think having different
  config options for individual components is tedious for both users and
  maintainers. If one wants to apply different behavior to different
  components, can explicitly use `compat-fallthrough`.
  See ntohq#16 (comment)
  • Loading branch information
kikuomax committed Feb 12, 2024
1 parent 11d725e commit 5f8a9fc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

* `Input` introduces a new prop `compat-fallthrough`, which determines whether `class`, `style`, and `id` attributes are applied to the root `<div>`, or either of `<input>` or `<textarea>` element.
If `true`, they are applied to the root `<div>` element, which is compatible with Vue 2.
The default value can be controlled by `defaultInputCompatFallthrough` config option (`true` by default).
The default value can be controlled by `defaultCompatFallthrough` config option (`true` by default).
[#16](https://github.com/ntohq/buefy-next/issues/16)

## buefy-next
Expand Down
2 changes: 1 addition & 1 deletion packages/buefy-next/src/components/input/Input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export default {
// if true, `class`, `style`, and `id` are applied to the root <div>
compatFallthrough: {
type: Boolean,
default: () => config.defaultInputCompatFallthrough
default: () => config.defaultCompatFallthrough
}
},
emits: [
Expand Down
7 changes: 4 additions & 3 deletions packages/buefy-next/src/utils/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ let config = {
defaultNoticeQueue: true,
defaultInputHasCounter: true,
/**
* Whether `class`, `style`, and `id` are applied to the root `<div>`
* element in `Input` by default.
* Whether `class`, `style`, and `id` are applied to the root element in
* components that are affected by Vue 3 change in fallthgourh beahvior.
* See: https://github.com/ntohq/buefy-next/issues/16
*/
defaultInputCompatFallthrough: true,
defaultCompatFallthrough: true,
defaultTaginputHasCounter: true,
defaultUseHtml5Validation: true,
defaultDropdownMobileModal: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/src/pages/components/input/api/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export default [
description: 'Whether <code>class</code>, <code>style</code>, and <code>id</code> attributes are applied to the root &lt;div&gt;, or either of &lt;input&gt; or &lt;textarea&gt; element. If <code>true</code>, they are applied to the root &lt;div&gt; element, which is compatible with Vue 2.',
type: 'Boolean',
values: '-',
default: '<code>true</code>. Can be changed via <code>defaultInputCompatFallthrough</code> config option.'
default: '<code>true</code>. Can be changed via <code>defaultCompatFallthrough</code> config option.'
},
{
name: 'Any native attribute',
Expand Down

0 comments on commit 5f8a9fc

Please sign in to comment.