react-native-android-widget icon indicating copy to clipboard operation
react-native-android-widget copied to clipboard

Multiple Overlay Widget Overlapping each other when tapping will be incorrect

Open longb1997 opened this issue 9 months ago • 0 comments

Hi, in my case, if you have multiple OverlapWidget overlapping each other. When you press it will only press the first OverlapWidget. Look like this: 2dc1c20b_9258_4bfc_a163_7fa68d6113e3 (1)

Since Overlap 2 has a height inside the first Overlap, when I press overlap 2, it activates the first Overlap. Thanks for helping!

This is code I used

{hours.map((hour, index) => {
        let eventsThisHour = eventsGroupedByHour[hour] ?? [];
        return (
          <OverlapWidget style={{width:'match_parent', height:'match_parent'}}>
            {eventsThisHour.map((meeting, meetingIndex) => {
              const meetingTime = moment(meeting.time, 'X');
              let eventHeight = calculateEventHeight(meeting, hourHeight);
              let eventTopOffset = calculateEventTopOffset(meeting, hourHeight, index);
              let eventOffsetX = calculateEventOffsetX(widgetWidth, meetingIndex)
               return (
                 <FlexWidget
                   key={meeting.id}
                   clickAction="OPEN_MEETING"
                   clickActionData={{
                     uri: `${baseDeepLink}${meeting.id}`,
                   }}
                   style={{
                     height: eventHeight,
                     backgroundColor: '#FFF',
                     borderRadius: 4,
                     width: widgetWidth / 4,
                     marginTop: eventTopOffset,
                     marginLeft: eventOffsetX,
                     borderColor: '#1E88E5',
                     borderWidth: 1,
                   }}
                 >
                   <STextWidget
                     truncate="END"
                     maxLines={1}
                     text={meeting.name}
                     type={'bold'}
                     textStyle={{
                       fontSize: 8,
                       color: '#2F3139',
                       paddingHorizontal: 2
                     }}
                   />
                 </FlexWidget>
            )})}
          </OverlapWidget>
        );
      })}

longb1997 avatar May 15 '24 07:05 longb1997