TransWikia.com

How to search filed and combobox field Mobile responsive of lightning web component

Salesforce Asked by Ankit verma on November 30, 2021

I have a lightning web component of addNewMember when i have tested on mobile its not responsive not showing full value in both fields, i have attached the screenshot and for the reference code is below

    <lightning-layout-item padding="horizontal-small" flexibility="none">
        <lightning-button type="submit" label="Search" variant="brand" onclick={actuallySearch}
                          disabled={searchDisabled}></lightning-button>
    </lightning-layout-item>
</lightning-layout>
<template if:true={tooManyResults}>
    <div class="slds-notify slds-notify_alert slds-theme_alert-texture slds-theme_warning" role="alert">
        <h2> {label.TooManyResultsMessage} </h2>
    </div>
</template>
<template if:true={isTableVisible}>
    <lightning-datatable data={searchResults} columns={columns} key-field="value" hide-checkbox-column="true"
                         onrowaction={handleRowAction} resize-column-disabled></lightning-datatable>
</template>
<template if:true={isNoSearchResultsMessageVisible}>
    <div class="slds-align_absolute-center">{label.NoSearchResultsMessage}</div>
</template>

================================================================

enter image description here

One Answer

You need to use the size attributes of the layout item. You can specify the different sizes for each layout item as per the device form factors.

Please note that this is mobile-first. So the size attribute will be applicable to the mobile devices.

  1. size -- default size, mobile devices.
  2. small-device-size -- size when the device is larger than mobile.
  3. medium-device-size -- size when the device is larger than tablets.
  4. large-device-size -- size when the device is larger than desktops.

Documentations for layout-item.
Playground example.

Answered by Rahul Gawale on November 30, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP