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

Resize QInput and other components / 输入框以及其它组件大小调节 #16441

Open
guangxs opened this issue Oct 10, 2023 · 6 comments
Open

Comments

@guangxs
Copy link

guangxs commented Oct 10, 2023

What happened?

I need to adjust the size of the input box during the development process to achieve good adaptation, but the current input box size is fixed and cannot be adjusted, and the button can be adjusted. Obviously, this half-component attribute should be patched

  • 我在开发过程中需要调节输入框大小以达到很好的自适应,但是目前输入框大小固定不可调节,对于按钮又可以调节,显然这种半有半无的组件属性,应该修补一下

What did you expect to happen?

The size adjustment of the component should support the size property similar to the QBtn assembly;

  • 组件的大小调节应该支持,类似按钮组建的size属性

Reproduction URL

https://quasar.dev/vue-components/input#native-form-submit

How to reproduce?

  1. Various components support size adjustment to meet adaptive
    1. 各种组件支持大小调节以满足自适应

Flavour

Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)

Areas

Components (quasar)

Platforms/Browsers

No response

Quasar info output

No response

Relevant log output

No response

Additional context

No response

@guangxs guangxs added kind/bug 🐞 Qv2 🔝 Quasar v2 issues labels Oct 10, 2023
@github-actions
Copy link

Hi @guangxs! 👋

It looks like you provided an invalid or unsupported reproduction URL.
Do not use any service other than Codepen, jsFiddle, StackBlitz, Codesandbox, and GitHub.
Make sure the URL you provided is correct and reachable. You can test it by visiting it in a private tab, another device, etc.
Please edit your original post above and provide a valid reproduction URL as explained.

Without a proper reproduction, your issue will have to get closed.

Thank you for your collaboration. 👏

@HarisSpahija
Copy link

What are you exactly looking for? That you can adjust the padding size?

You can already adjust input sizing using overrides with input-style and input-class.
See example: https://codepen.io/harisspahija/pen/BavbzGB

It would help to share what input style you are trying to achieve so we can replicate it using the quasar way.

@guangxs
Copy link
Author

guangxs commented Oct 11, 2023 via email

@HarisSpahija
Copy link

HarisSpahija commented Oct 11, 2023

Ah I understand. that shouldnt be too hard to implement. There is already a general useSizeProps in https://github.com/quasarframework/quasar/blob/dev/ui/src/composables/private/use-size.js that we can reuse. Im not sure what the impact is on just implementing this everywhere, but it seems quite easy to just update QInput with

https://github.com/quasarframework/quasar/blob/dev/ui/src/components/input/QInput.js

props: {
	...useSizeProps
}

followed by

const sizeStyle = useSize(props, defaultSizes)

 getControl: () => {
        return h(isTextarea.value === true ? 'textarea' : 'input', {
          ref: inputRef,
          class: [
            'q-field__native q-placeholder',
            props.inputClass
          ],
          style: { ...props.inputStyle,  ...sizeStyle },
          ...inputAttrs.value,
          ...onEvents.value,
          ...(
            props.type !== 'file'
              ? { value: getCurValue() }
              : formDomProps.value
          )
        })
      },

Perhaps there will be some things broken in the animations for label. Ill experiment a bit with this.

@HarisSpahija
Copy link

So after experimenting its quite easy to add sizing. Its more the question what sizes should we support. Just increasing the font-size and padding might not be the most useful feature. Anyone any ideas?

@metalsadman metalsadman added kind/feature 💡 and removed bug/0-needs-info Need more info to reproduce kind/bug 🐞 labels Oct 11, 2023
@sohaha
Copy link

sohaha commented Jan 5, 2024

Any new developments on this

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

No branches or pull requests

4 participants